Print(f"\nWe can solve M^e with CRT to get ") In Python, we can either use:įrom import bytes_to_long, long_to_bytes We thus need to get the 3rd root of the result of the CRT method. If we assume that \(e=3\) and then we get: Once we have this we can determine \(M\). We can then solve for \(M^e\) with Chinese Remainder Theorem (CRT). Now we have a message (M), and create a cipher with: We start by generating two prime numbers (\(p,q\)) and then calculate the modulus (\(N\)): Next we convert this integer to bytes, and display as a string. If we assume e=3, we take the third root to get: 1952805748
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |