Sample code for 30+ languages & platforms
PowerBuilder

Example: Crypt2.SetEncodedIV method

Demonstrates how to call the SetEncodedIV method.

Chilkat PowerBuilder Downloads

PowerBuilder
integer li_rc
oleobject loo_Crypt

loo_Crypt = create oleobject
li_rc = loo_Crypt.ConnectToNewObject("Chilkat.Crypt2")
if li_rc < 0 then
    destroy loo_Crypt
    MessageBox("Error","Connecting to COM object failed")
    return
end if

loo_Crypt.CryptAlgorithm = "aes"
loo_Crypt.CipherMode = "cbc"
loo_Crypt.KeyLength = 256

// Note: The lenght of the IV is equal to the block size of the symmetric encryption algorithm.
// The block size for AES is 16 bytes.  Therefore, the IV is 16 bytes regardless of the encryption strenght (128-bit, 256-bit, etc.)
loo_Crypt.SetEncodedIV("000102030405060708090A0B0C0D0E0F","hex")

// ...
// ...


destroy loo_Crypt