Exemplo n.º 1
0
        public void Crypto_Hash_String_test()
        {
            var cryptographyService = new CryptographyService(WinRTCrypto.CryptographicEngine, WinRTCrypto.SymmetricKeyAlgorithmProvider, WinRTCrypto.HashAlgorithmProvider, new Logger());

            var valueString            = "3nNkJ5EcI7yyi56ifLSAA";
            var hashedString           = cryptographyService.GetHashString(valueString);
            var hashedStringWithoutPcl = CryptographyHelperWithoutPcl.GetHashString(valueString);

            Assert.AreEqual(hashedString, hashedStringWithoutPcl);
        }
Exemplo n.º 2
0
        public static string Decrypt(byte[] data)
        {
            if (data == null)
            {
                return(null);
            }

            if (data.Length == 0)
            {
                return(string.Empty);
            }

            return(CryptographyHelperWithoutPcl.DecryptStringFromBytes_Aes(data, _aes128Key, _initVector));
        }
Exemplo n.º 3
0
 public static byte[] Encrypt(string data)
 {
     return(CryptographyHelperWithoutPcl.EncryptStringToBytes_Aes(data, _aes128Key, _initVector));
 }