>>>Encrypt(cStringtoEncrypt, cSecretKey[, nEncryptionType[, nEncryptionMode[, nPaddingType[, nKeySize[, nBlockSize[, cIV]]]]]]) >>>Decrypt(cEncryptString, cSecretKey[, nDecryptionType[, nDecryptionMode[, nPaddingType[, nKeySize[, nBlockSize[, cIV]]]]]]) >>>>>>
> >Encrypt('915-555-1212', 'MyKey'[, 6[, 'yadda'[,32[, 8[, 64[, SomeValue]]]]]]) > >>
function EncryptionTest() set library to D:\tmp\In\vfpencryption90\vfpencryption.fll additive local cStringtoEncrypt, ; cSecretKey, ; nEncryptionType, ; nKeySize, ; nEncryptionMode, ; nPaddingType, ; nBlockSize, ; cIV && Encrypt cStringtoEncrypt = '915-555-1212' nEncryptionType = 2 && or 0 or 1 do case case m.nEncryptionType == 0 nKeySize = 16 case m.nEncryptionType == 1 nKeySize = 24 case m.nEncryptionType == 2 nKeySize = 32 otherwise error 'unknown nEncryptionType ' endcase cSecretKey = padr('MyKey', m.nKeySize, chr(0)) nEncryptionMode = 1 && CBC - we will need an IV nPaddingType = 4 && ISO 10126 nBlockSize = 16 && or 24 or 32 cIV = replicate(chr(0), m.nBlockSize) && Can be anything - but nBlockSize long local encryptedValue encryptedValue = ENCRYPT(m.cStringtoEncrypt, m.cSecretKey, m.nEncryptionType, m.nEncryptionMode, m.nPaddingType, m.nKeySize, m.nBlockSize, m.cIv) ? len(m.encryptedValue), strconv(m.encryptedValue,15) local decryptedValue decryptedValue= Decrypt(m.encryptedValue, m.cSecretKey, m.nEncryptionType, m.nEncryptionMode, m.nPaddingType, m.nKeySize, m.nBlockSize, m.cIv) ? len(m.decryptedValue), m.decryptedValue, ' ', m.decryptedValue == cStringtoEncrypt *_______________________________________________________________________________