![]() ![]() This concept results in m becoming larger and larger with increasing plaintext length. ![]() Then, the string is converted to an integer m which is used as message and encrypted according to ![]() In the code, the plaintext is encoded into a string by using the corresponding decimal ASCII-code (formatted to three digits) for each character, e.g. Has anyone an idea what could be wrong and what has to be changed, that the decryption gives the right answer? # check for m being greater than 0, ignore it otherwise # loop through the string representing the binary form of the exponent while ignoring the leftmost bit and perform My square and multiply method looks like this: def squareAndMultiply(x, n, m=0): # put decryption result into ascii format and use ascii to decode it # Turn message string into ascii so it can be used for encryption """return (g, x, y) such that a*x + b*y = g = gcd(a, b)""" But the result is something like this: ÜŞϟʐͶz̽ć def xgcd(a, b): After I've encrypted the String I tried to decrypt it as well. I´m trying to encrypt a String with 2 prime numbers. ![]()
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |