public static byte[] DecodeFromBase64(this ISimpleCryptoProvider c, string data, byte[] key)
        {
            var bytes    = CryptoHelper.String64ToBytes(data);
            var decBytes = c.Decode(bytes, key);

            return(decBytes);
        }
示例#2
0
        public static string ValidatedDecode(string data)
        {
            if (string.IsNullOrEmpty(data))
            {
                return(null);
            }

            var bytes    = CryptoHelper.String64ToBytes(data);
            var decBytes = ValidatedDecode(bytes);

            if (decBytes == null)
            {
                return(null);
            }

            var str = CryptoHelper.BytesToString(decBytes);

            return(str);
        }