Exemplo n.º 1
0
        } // End Function Crypt

        public static string GenerateKey()
        {
            byte[] bIV  = null;
            byte[] bKey = null;

            using (System.Security.Cryptography.TripleDES des3 = System.Security.Cryptography.TripleDES.Create())
            {
                des3.GenerateKey();
                des3.GenerateIV();
                bIV  = des3.IV;
                bKey = des3.Key;
            } // End Using des3

            return("IV: " + AES.ByteArrayToHexString(bIV) + System.Environment.NewLine + "Key: " + AES.ByteArrayToHexString(bKey));
        } // End Function GenerateKey
Exemplo n.º 2
0
        public static string GenerateKey()
        {
            string retValue = null;

            using (System.Security.Cryptography.TripleDES des3 = System.Security.Cryptography.TripleDES.Create())
            {
                des3.GenerateKey();
                des3.GenerateIV();

                byte[] bIV  = des3.IV;
                byte[] bKey = des3.Key;

                retValue = "IV: " + AesEncryptionService.ByteArrayToHexString(bIV)
                           + System.Environment.NewLine
                           + "Key: " + AesEncryptionService.ByteArrayToHexString(bKey);
            } // End Using des3

            return(retValue);
        } // End Function GenerateKey
Exemplo n.º 3
0
        } // End Function Crypt

        public static string GenerateKey()
        {
            string returnValue = null;

            using (System.Security.Cryptography.TripleDES des3 = System.Security.Cryptography.TripleDES.Create())
            {
                des3.GenerateKey();
                des3.GenerateIV();
                byte[] bIV  = des3.IV;
                byte[] bKey = des3.Key;

                returnValue = "IV: " + AES.ByteArrayToHexString(bIV) + System.Environment.NewLine + "Key: " + AES.ByteArrayToHexString(bKey);

                System.Array.Clear(bIV, 0, bIV.Length);
                bIV = null;

                System.Array.Clear(bKey, 0, bKey.Length);
                bKey = null;
            }

            return(returnValue);
        } // End Function GenerateKey