Hi everyone,
Earlier this month I asked this forum for solutions to be able to encrypt and decrypt data from within ProIV. Wim Soutendijk was kind enough to send me a SSO solution he had developed. His solution used a fixed encryption key whereas we required the ability to pass it a user supplied key. Anyway, I had it enhanced to do so and enclosed is a copy for anyone who wants to use it.
The SSO has two methods; encrypt & decrypt and does 64 bit encryption. The encryption key you pass it has to be 16 characters long. If our user wants to use a shorter key we just pad it to 16. The beauty of this solution is that it's self contained within ProIV and doesn't require external encryption. Please feel free to use it.
Regards
Ross
ENCRYPTION
data parameters
$DATA
$KEY
test logic
$DATA = 'HELLO WORLD'
$KEY = .abcdefghijklmnop'
$DATA_ENCRYPTED = SSOEncrypt.encrypt(data)
Result - $DATA_ENCRYPTED = "Bjjxn1B24S1yi/bmBX/8+Q=="
DECRYPTION
data2 parameters
$DATA_ENCRYPTED
$KEY
test logic
$DATA_ENCRYPTED = "Bjjxn1B24S1yi/bmBX/8+Q=="
$KEY = .abcdefghijklmnop'
$DATA = SSOEncrypt.decrypt(data2)
Result - $DATA = 'HELLO WORLD'
If an invalid key is used on the decrypt method a string of "BADKEY" is returned.