1.rsa3.cpp is the main part, and it relys on bignum3.h
2.The code style and some parts are referenced from the book- Cryptography in C and C++ Second Edition
3.The efficiency is not so good, but if you compile it use the optimization in VS, it seems so good!
4.If you want to test rsa.cpp,you need a file called 'plain.txt' in your project filefolder,and copy the xxxprime.txt to your project folder(or you can do exclu()function at the beginning).You also need to change the 'include' path at the beginning of rsa.cpp. And to avoid errors, the content of plain.txt is suggested to be a SHA-1 result of another file.
5.If you want to test rsa3.cpp,you need a file called 'plain.txt' in your project filefolder.It contained less than 128bytes contents in hex form. It can be SHA-1 result like '4EA72B9F99A196581A8ED410DC3016FC74130B26'. You also need to change the 'include' path at the beginning of rsa3.cpp to include 'bignum3.h'. debug=1 is to find a prime <=1024bits , and debug=0 is to do RSA process. And to avoid errors, the content of plain.txt is suggested to be a SHA-1 result of another file.
6.if you encounter problem below, add _SCL_SECURE_NO_WARNINGS to your C/C++compiler preprocessor definition : C4996 'std::basic_string<char,std::char_traits,std::allocator>::copy': Call to 'std::basic_string::copy' with parameters that may be unsafe - this call relies on the caller to check that the passed values are correct. To disable this warning, use -D_SCL_SECURE_NO_WARNINGS. See documentation on how to use Visual C++ 'Checked Iterators' 2018tst d:\密码学\my特别快的rsa and bn\rsa2.cpp 465