ComponentFactory.Krypton.Ribbon.EncryptedLicenseProvider.GetEncryptionKey C# (CSharp) Method

GetEncryptionKey() private static method

Generate an 8 byte DES encryption key using the given password
Only the first 7 bytes of the key returned are used. This enables us to reduce the size of the final license keys by 8 bytes.
private static GetEncryptionKey ( string password ) : byte[]
password string The password used to generate the key
return byte[]
        private static byte[] GetEncryptionKey(string password)
        {
            byte[] key = new byte[] { 0xF2, 0xA1, 0x03, 0x9D, 0x63, 0x87, 0x35, 0x5E };
            byte[] iv = new byte[] { 0xAB, 0xB8, 0x94, 0x7E, 0x1D, 0xE5, 0xD1, 0x33 };

            DESCryptoServiceProvider des = new DESCryptoServiceProvider();
            des.Key = key;
            des.IV = iv;

            if (password.Length < 8)
                password = password.PadRight(8, '*');
            byte[] data = ASCIIEncoding.ASCII.GetBytes(password);
            byte[] encData = des.CreateEncryptor().TransformFinalBlock(data, 0, data.Length);
            byte[] result = new byte[ArraySize(8)];
            Array.Copy(encData, 0, result, 0, keyLength);
            return result;
        }