예제 #1
0
        static void Main(string[] args)
        {
            string content = "Mr@1234_$%!";
            RSAKey rsaKey  = RsaHelper.CreateRsaKey();

            WriteLine($"PrivateKey:{rsaKey.PrivateKey}");
            WriteLine();
            WriteLine($"PublicKey;{rsaKey.PublicKey}");
            WriteLine();

            WriteLine($"{content} 加密后:");
            string e = RsaHelper.RSAEncrypt(content, rsaKey.PublicKey);

            WriteLine(e);

            WriteLine($"解密后:{RsaHelper.RSADecrypt(e, rsaKey.PrivateKey)}");

            ReadKey();
        }