Connection Information

To perform the requested action, WordPress needs to access your web server. Please enter your FTP credentials to proceed. If you do not remember your credentials, you should contact your web host.

Connection Type

SymmetricDecrypt – PB Docs 2022 – PowerBuilder Library

SymmetricDecrypt – PB Docs 2022

SymmetricDecrypt

PowerScript function

Description

Decrypts a blob value using symmetric algorithm.

Applies to

CrypterObject objects

Syntax

Argument

Description

crypter

The name of the CrypterObject object.

algorithm

A value of the SymmetricAlgorithm enumerated type that
specifies the type of symmetric algorithm.

Values are:

  • AES! – The Advanced Encryption Standard

  • DES! – The Data Encryption Standard

  • TDES! – The Triple-DES

  • DESX! – The DES-XEX3

  • Blowfish! – The Blowfish

variable

A blob whose value is the data you want to decrypt with
symmetric algorithm.

When using the system blob function to convert a string to
a blob, it is recommended to specify its encoding argument to be
EncodingANSI! (for English characters only) or EncodingUTF8!,
otherwise, the default EncodingUTF16LE! will be used.

key

A blob specifying the secret key.

The length of the secret key can be 128 bits, 192 bits,
256 bits with AES.

The length of the secret key must be 64 bits with
DES.

The length of the secret key can be 128 bits, 192 bits
with TDES.

The length of the secret key must be 192 bits with
DESX.

The length of the secret key can be 32 bits~448 bits with
Blowfish.

operationmode (optional)

A value of the OperationMode enumerated type that
specifies the mode of operation.

Values are:

  • OperationModeECB! – (Default) The Electronic Codebook
    (ECB) mode

  • OperationModeCBC! – The Cipher Block Chaining (CBC)
    mode

  • OperationModeCFB! – The Cipher Feedback (CFB)
    mode

  • OperationModeOFB! – The Output Feedback (OFB)
    mode

  • OperationModeCTR! – The Counter (CTR) mode

iv (optional)

A blob specifying the initialization vector. Zeros filled
by default. In the AES algorithm, the effective length of the iv
is 16 bytes and the others are 8 bytes. If the length is not
enough, it will be automatically filled with zeros. In the ECB
operation mode, the iv will be ignored.

padding (optional)

A value of the PaddingScheme enumerated type that
specifies the padding schemes used for block cipher.

Values are:

  • NoPadding! – No padding added to a block

  • ZerosPadding! – 0’s padding added to a block

  • PKCSPadding! – PKCS #5 padding added to a block

  • OneAndZerosPadding! – 1 and 0’s padding added to a
    block

  • DefaultPadding! – (Default) Default padding scheme.
    DefaultPadding! means PKCSPadding! for ECB or CBC mode.
    Otherwise, NoPadding! for modes like CFB, OFB, and
    CTR.

ZerosPadding!, PKCSPadding!, and OneAndZerosPadding! can
be used with ECB and CBC operation mode. NoPadding! can be used
with CFB, OFB and CTR operation mode.

Return value

Blob.

Returns the result of the decrypt if it succeeds. If any argument’s
value is null, the method returns null. If an error occurs, throw the
exception.

Examples

The following statements encrypt the data using AES and then decrypt
the data using AES.

See also

SymmetricEncrypt

SymmetricGenerateKey

AsymmetricEncrypt

AsymmetricDecrypt

AsymmetricSign

AsymmetricVerifySign

AsymmetricGenerateKey

MD5

SHA

HMAC


Document get from Powerbuilder help
Thank you for watching.
Was this article helpful?
Subscribe
Notify of
guest
0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x