示例#1
0
        public string Desencriptar(string texto)
        {
            UTF8Encoding ByteConverter = new UTF8Encoding();

            byte[] cifradoBytes = Encriptacion.StringHexToByteArray(texto);

            byte[] descifradoBytes = rsa.Decrypt(cifradoBytes, true);

            return(ByteConverter.GetString(descifradoBytes));
        }
示例#2
0
        public string Encriptar(string texto)
        {
            UTF8Encoding ByteConverter = new UTF8Encoding();

            byte[] textoBytes = ByteConverter.GetBytes(texto);

            byte[] cifradoBytes = rsa.Encrypt(textoBytes, true);

            return(Encriptacion.ByteArrayToStringHex(cifradoBytes));
        }