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);
        }
Exemple #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));
        }
Exemple #3
0
 public static byte[] Encrypt(string data)
 {
     return(CryptographyHelperWithoutPcl.EncryptStringToBytes_Aes(data, _aes128Key, _initVector));
 }