示例#1
0
        public static ICryptoValue Decrypt(byte[] cipherBytes, byte[] pwd)
        {
            var key      = Factory.GenerateKey(pwd);
            var function = Factory.Create(RcTypes.RC4, key);

            return(function.Decrypt(cipherBytes));
        }
示例#2
0
        public static ICryptoValue Encrypt(RcTypes type, byte[] originalBytes, byte[] pwd)
        {
            var key      = Factory.GenerateKey(pwd);
            var function = Factory.Create(type, key);

            return(function.Encrypt(originalBytes));
        }
示例#3
0
        public static ICryptoValue Decrypt(RcTypes type, string cipherText, string pwd, CipherTextTypes cipherTextType, Encoding encoding = null, Func <string, byte[]> customConverter = null)
        {
            encoding = encoding.SafeEncodingValue();
            var key      = Factory.GenerateKey(pwd, encoding);
            var function = Factory.Create(type, key);

            return(function.Decrypt(cipherText, cipherTextType, encoding, customConverter));
        }
示例#4
0
        public static ICryptoValue Decrypt(RcTypes type, string cipherText, string pwd, Encoding encoding = null)
        {
            encoding = encoding.SafeEncodingValue();
            var key      = Factory.GenerateKey(pwd, encoding);
            var function = Factory.Create(type, key);

            return(function.Decrypt(cipherText, encoding));
        }
示例#5
0
        public static ICryptoValue Encrypt(string originalText, string pwd, Encoding encoding = null)
        {
            encoding = encoding.SafeEncodingValue();
            var key      = Factory.GenerateKey(pwd, encoding);
            var function = Factory.Create(RcTypes.RC4, key);

            return(function.Encrypt(originalText, encoding));
        }
示例#6
0
 public static IRC Create(RcTypes type, byte[] pwd) => Factory.Create(type, pwd);
示例#7
0
 public static IRC Create(RcTypes type, RcKey key) => Factory.Create(type, key);
示例#8
0
 public static IRC Create(RcTypes type, string pwd, Encoding encoding = null) => Factory.Create(type, pwd, encoding);
示例#9
0
 public static IRC Create(RcTypes type) => Factory.Create(type);
示例#10
0
 public static RcKey GenerateKey(byte[] pwd) => Factory.GenerateKey(pwd);
示例#11
0
 public static RcKey GenerateKey(string pwd, Encoding encoding) => Factory.GenerateKey(pwd, encoding);
示例#12
0
 public static RcKey GenerateKey() => Factory.GenerateKey();