コード例 #1
0
        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
ファイル: MachineCrypto.cs プロジェクト: mateuscezar/netgore
 /// <summary>
 /// Initializes the <see cref="MachineCrypto"/> class.
 /// </summary>
 static MachineCrypto()
 {
     _crypt = XorCryptoProvider.Create();
     _instance = new MachineCrypto();
 }
コード例 #3
0
 /// <summary>
 /// Initializes the <see cref="MachineCrypto"/> class.
 /// </summary>
 static MachineCrypto()
 {
     _crypt    = XorCryptoProvider.Create();
     _instance = new MachineCrypto();
 }
コード例 #4
0
        public static byte[] Decode(this ISimpleCryptoProvider c, string data, byte[] key)
        {
            var bytes = CryptoHelper.StringToBytes(data);

            return(c.Decode(bytes, key));
        }
コード例 #5
0
        public static string EncodeToBase64(this ISimpleCryptoProvider c, byte[] data, byte[] key)
        {
            var encBytes = c.Encode(data, key);

            return(CryptoHelper.BytesToString64(encBytes));
        }
コード例 #6
0
        public static string EncodeToBase64(this ISimpleCryptoProvider c, string data, byte[] key)
        {
            var bytes = CryptoHelper.StringToBytes(data);

            return(c.EncodeToBase64(bytes, key));
        }
コード例 #7
0
        public static string DecodeStringFromBase64(this ISimpleCryptoProvider c, string data, byte[] key)
        {
            var decBytes = c.DecodeFromBase64(data, key);

            return(CryptoHelper.BytesToString(decBytes));
        }