public static string Decrypt(RSAKeyEncoded encodedKey, string encryptedText, ByteEncodeMethod ByteEncode, Encoding TextEncode) { RSAParameters key = encodedKey.ToRSAParameters(); byte[] encryptedText2 = ByteArrayEncoder.Decode(encryptedText, ByteEncode); byte[] bytes = RSASimpleWrapper.Decrypt(key, encryptedText2); return(TextEncode.GetString(bytes)); }
public static string Encrypt(RSAKeyEncoded encodedKey, string plainText, ByteEncodeMethod ByteEncode, Encoding TextEncode) { RSAParameters key = encodedKey.ToRSAParameters(); byte[] bytes = TextEncode.GetBytes(plainText); byte[] byteArray = RSASimpleWrapper.Encrypt(key, bytes); return(ByteArrayEncoder.Encode(byteArray, ByteEncode)); }