Fake coin injection

I was bored, so I started to understand a little cryptography. I became interested in this Fair-Coin Flipping protocol. This protocol works with public key cryptography, but requires the algorithm to switch (something like RSA, I think). I thought it would be interesting to write this in C or C ++, and it was interesting how people usually do this public key cryptography in C or C ++. For example, the first few steps of the protocol:

  • Alice and Bob generate a pair of public / private keys (which is a commutative secret)
  • Alice generates two messages: one points to the heads, and the other points to the tails and encrypts them both with her key and sends them to Bob.
  • ...
  • ...

Now, for the message, I will probably use a string, but are there any good libraries for generating public / private keys and encrypting this string, etc.?

+4
source share
2 answers

Take a look at something like crypto ++ , instead of doing cryptography yourself. There are other commercial libraries, but this should give you a good start.

+4
source

I wrote a cryptographic library as part of a university assignment in combinatorics. I used the GMP (GNUs Multiple Precision) library to generate random huge numbers (any number of bits your computer can process. Thus, a 4096 bit number is easy!)

+1
source

All Articles