<% strCompanyUserEncryptionPassword="fsOcBk749Jfseh90ig97gi7g9gi7gt" strDriverEncryptionPassword="fsOcXk12ppxZLi3l8d4bGgfxb" strCustEncryptionPassword="fsOcBk18spxZoi1l8d4bfgfxS" strPayEncryptionPassword="fsOcBkdewu2jsHKdswi7fgfxS" Function generatePassword(passwordLength) 'Declare variables Dim sDefaultChars Dim iCounter Dim sMyPassword Dim iPickedChar Dim iDefaultCharactersLength Dim iPasswordLength 'Initialize variables sDefaultChars="-abcdefghijklmnopqrstuvxyz.!ABCDEFGHIJKLMNOPQRSTUVXYZ.!0123456789" iPasswordLength=passwordLength iDefaultCharactersLength = Len(sDefaultChars) Randomize'initialize the random number generator 'Loop for the number of characters password is to have For iCounter = 1 To iPasswordLength 'Next pick a number from 1 to length of character set iPickedChar = Int((iDefaultCharactersLength * Rnd) + 1) 'Next pick a character from the character set using the random number iPickedChar 'and Mid function sMyPassword = sMyPassword & Mid(sDefaultChars,iPickedChar,1) Next generatePassword = sMyPassword End Function '************************************************************************************************** 'Form AES Encryption wrapper functions '************************************************************************************************** public function CUSEREncryptAndEncode(strIn) '** AES encryption, CBC blocking with PKCS5 padding then HEX encoding - DEFAULT ** CUSEREncryptAndEncode="@" & AESEncrypt(strIn,strCompanyUserEncryptionPassword) end function public function CUSERDecodeAndDecrypt(strIn) CUSERDecodeAndDecrypt=AESDecrypt(mid(strIn,2),strCompanyUserEncryptionPassword) end function public function DRVEncryptAndEncode(strIn) DRVEncryptAndEncode="@" & AESEncrypt(strIn,strDriverEncryptionPassword) end function public function DRVDecodeAndDecrypt(strIn) DRVDecodeAndDecrypt=AESDecrypt(mid(strIn,2),strDriverEncryptionPassword) end function public function CustEncryptAndEncode(strIn) CustEncryptAndEncode="@" & AESEncrypt(strIn,strCustEncryptionPassword) end function public function CustDecodeAndDecrypt(strIn) CustDecodeAndDecrypt=AESDecrypt(mid(strIn,2),strCustEncryptionPassword) end function public function PayEncryptAndEncode(strIn) PayEncryptAndEncode="@" & AESEncrypt(strIn,strPayEncryptionPassword) end function public function PayDecodeAndDecrypt(strIn) PayDecodeAndDecrypt=AESDecrypt(mid(strIn,2),strPayEncryptionPassword) end function %> <%=CUSEREncryptAndEncode("qwerty123!")%>
<%x=CUSEREncryptAndEncode("qwerty123!")%><%=CUSERDecodeAndDecrypt(x)%>