Overview


The RSA Encryption API enables encrypting data using the RSA encryption algorithm with SHA1 hash, OAEP padding and MGF1 mask generation. The keys used for encryption and decryption are generated based on the user-defined parameters, which enable selecting the format of the keys (either DER or PEM) and the strength of the encryption process. The encryption methods use the encryption key to transform either string data or binary data into Base-64 encoded strings.

The RSA encryption/decryption methods operate on data blocks. The size of input/output blocks is calculated according to the formulas given below.

Encryption input/decryption output block size:

Decryption input/encryption output block size:

Note

For details on certificate encoding standards, please refer to the SSL Knowledgebase.

The encryption strength is defined by setting the size of the keys, expressed in bits.

Module

This object belongs to the RSA Encryption product module.

RSA Encryption API

The RSA encryption API module is called via the window.launchbox.encryption.RSA reference.

The following constants may be used during the key generation process:

Name Description
DER_FORMAT Denotes that the DER (Base-64 encoded) format should be used while generating the encryption keys.
PEM_FORMAT Denotes that the PEM format should be used while generating the encryption keys.

The RSA encryption API object uses the following five methods.

Name Description Return type

generateKeys

Generates the RSA encryption keys. This method is a prerequisite for the remaining methods.

undefined

encrypt

Accepts string data to return a Base-64 encoded string containing encrypted data.

undefined

encryptBinary

Accepts binary data to return a Base-64 encoded string containing encrypted data.

undefined

decrypt

Accepts a Base-64 encoded string containing encrypted data to return decrypted string data.

undefined

decryptBinary

Accepts a Base-64 encoded string containing encrypted data to return decrypted binary data.

undefined

Related topics

Public API reference
Legal notice | Copyright © 2015 and Confidential to Pegasystems Inc. All rights reserved. | Feedback
Advanced...