Ejemplo n.º 1
0
        public static ICryptoValue Encrypt(DesTypes type, byte[] originalBytes, byte[] pwd, byte[] iv, byte[] salt)
        {
            var key      = Factory.GenerateKey(type, pwd, iv);
            var function = Factory.Create(type, key);

            return(function.Encrypt(originalBytes, salt));
        }
Ejemplo n.º 2
0
        public static ICryptoValue Decrypt(DesTypes type, byte[] cipherBytes, byte[] pwd, byte[] iv, byte[] salt)
        {
            var key      = Factory.GenerateKey(type, pwd, iv);
            var function = Factory.Create(type, key);

            return(function.Decrypt(cipherBytes, salt));
        }
Ejemplo n.º 3
0
        public static ICryptoValue Encrypt(byte[] originalBytes, byte[] pwd, byte[] iv)
        {
            var key      = Factory.GenerateKey(DesTypes.DES, pwd, iv);
            var function = Factory.Create(DesTypes.DES, key);

            return(function.Encrypt(originalBytes));
        }
Ejemplo n.º 4
0
        public static ICryptoValue Decrypt(byte[] cipherBytes, byte[] pwd, byte[] iv)
        {
            var key      = Factory.GenerateKey(DesTypes.DES, pwd, iv);
            var function = Factory.Create(DesTypes.DES, key);

            return(function.Decrypt(cipherBytes));
        }
Ejemplo n.º 5
0
        public static ICryptoValue Decrypt(string cipherText, string pwd, string iv, Encoding encoding = null)
        {
            encoding = encoding.SafeEncodingValue();
            var key      = Factory.GenerateKey(DesTypes.DES, pwd, iv, encoding);
            var function = Factory.Create(DesTypes.DES, key);

            return(function.Decrypt(cipherText, encoding));
        }
Ejemplo n.º 6
0
        public static ICryptoValue Encrypt(DesTypes type, string originalText, string pwd, string iv, string salt, Encoding encoding = null)
        {
            encoding = encoding.SafeEncodingValue();
            var key      = Factory.GenerateKey(type, pwd, iv, encoding);
            var function = Factory.Create(type, key);

            return(function.Encrypt(originalText, salt, encoding));
        }
Ejemplo n.º 7
0
        public static ICryptoValue Decrypt(DesTypes type, string cipherText, string pwd, string iv, string salt, CipherTextTypes cipherTextType, Encoding encoding = null, Func <string, byte[]> customConverter = null)
        {
            encoding = encoding.SafeEncodingValue();
            var key      = Factory.GenerateKey(type, pwd, iv, encoding);
            var function = Factory.Create(type, key);

            return(function.Decrypt(cipherText, salt, cipherTextType, encoding, customConverter));
        }
Ejemplo n.º 8
0
 public static IDES Create(DesTypes type, DesKey key) => Factory.Create(type, key);
Ejemplo n.º 9
0
 public static IDES Create(DesTypes type, byte[] pwd, byte[] iv) => Factory.Create(type, pwd, iv);
Ejemplo n.º 10
0
 public static IDES Create(DesTypes type, string pwd, string iv, Encoding encoding = null) => Factory.Create(type, pwd, iv, encoding);
Ejemplo n.º 11
0
 public static IDES Create(DesTypes type) => Factory.Create(type);
Ejemplo n.º 12
0
 public static IDES Create() => Factory.Create();
Ejemplo n.º 13
0
 public static DesKey GenerateKey(DesTypes type, byte[] pwd, byte[] iv) => Factory.GenerateKey(type, pwd, iv);
Ejemplo n.º 14
0
 public static DesKey GenerateKey(DesTypes type, string pwd, string iv, Encoding encoding) => Factory.GenerateKey(type, pwd, iv, encoding);
Ejemplo n.º 15
0
 public static DesKey GenerateKey(DesTypes type = DesTypes.DES) => Factory.GenerateKey(type);