Class Index | File Index

Classes


Class KJUR.crypto.Cipher

Cipher class to encrypt and decrypt data

Defined in: crypto-1.1.js.

Class Summary
Constructor Attributes Constructor Name and Description
 
Cipher class to encrypt and decrypt data
Here is supported canonicalized cipher algorithm names and its standard names:
  • aes256-CBC
  • aes128-CBC
  • des-EDE3-CBC
NOTE: From jsrsasign 11.0.0, RSA and RSAOAEP encryption/decryption support is removed because of Marvin attack vulnerability.
Method Summary
Method Attributes Method Name and Description
<static>  
KJUR.crypto.Cipher.decrypt(hex, hexadecimal, algName, param)
decrypt encrypted hexadecimal string with specified key and algorithm
This static method decrypts encrypted hexadecimal string with specified key and algorithm.
<static>  
KJUR.crypto.Cipher.encrypt(s, hexadecimal, algName, param)
encrypt raw string by specified key and algorithm
This static method encrypts raw string with specified key and algorithm.
Class Detail
KJUR.crypto.Cipher(params)
Cipher class to encrypt and decrypt data
Here is supported canonicalized cipher algorithm names and its standard names:
  • aes256-CBC
  • aes128-CBC
  • des-EDE3-CBC
NOTE: From jsrsasign 11.0.0, RSA and RSAOAEP encryption/decryption support is removed because of Marvin attack vulnerability.
Parameters:
{Array} params
parameters for constructor
Since:
jsrsasign 6.2.0 crypto 1.1.10
Method Detail
<static> {string} KJUR.crypto.Cipher.decrypt(hex, hexadecimal, algName, param)
decrypt encrypted hexadecimal string with specified key and algorithm
This static method decrypts encrypted hexadecimal string with specified key and algorithm.
NOTE: From jsrsasign 10.9.0, asymmetric cipher ({des-EDE3,aes{128,256}}-CBCis also supported. NOTE2: From jsrsasign 11.0.0, RSA and RSAOAEP encryption/decryption support is removed because of Marvin attack vulnerability.
KJUR.crypto.Cipher.decrypt("12abcd...", "5a7d...", "aes256-CBC", { iv: "1b3c..." }) 
KJUR.crypto.Cipher.decrypt("12abcd...", "5a7d...", any, { encalg: "aes128-CBC", iv: "1b3c..." }) 
KJUR.crypto.Cipher.decrypt("12abcd...", any, any, { encalg: "des-EDE3-CBC", iv: "1b3c...", key: "3d41..." }) 
KJUR.crypto.Cipher.decrypt(any, any, any, { encalg: "des-EDE3-CBC", iv: "1b3c...", key: "3d41...", enc: "12abcd..." })
Parameters:
{string} hex
hexadecimal string of encrypted message
{object} hexadecimal
string of symmetric cipher key
{string} algName
short/long algorithm name for encryption/decryption (OPTION)
{object} param
parameters for synchronous cipher such as initial vector (OPTION)
Since:
jsrsasign 6.2.0 crypto 1.1.10
Returns:
{string} decrypted raw string

<static> {string} KJUR.crypto.Cipher.encrypt(s, hexadecimal, algName, param)
encrypt raw string by specified key and algorithm
This static method encrypts raw string with specified key and algorithm.
NOTE: From jsrsasign 10.9.0, asymmetric cipher ({des-EDE3,aes{128,256}}-CBC) is also supported. NOTE2: From jsrsasign 11.0.0, RSA and RSAOAEP encryption/decryption support is removed because of Marvin attack vulnerability.
KJUR.crypto.Cipher.encrypt("12abcd...", "5a7d...", "aes256-CBC", { iv: "1b3c..." }) 
KJUR.crypto.Cipher.encrypt("12abcd...", "5a7d...", any, { encalg: "aes128-CBC", iv: "1b3c..." }) 
KJUR.crypto.Cipher.encrypt("12abcd...", any, any, { encalg: "des-EDE3-CBC", iv: "1b3c...", key: "3d41..." }) 
KJUR.crypto.Cipher.encrypt(any, any, any, { encalg: "des-EDE3-CBC", iv: "1b3c...", key: "3d41...", enc: "12abcd..." })
Parameters:
{string} s
input string to encrypt
{string} hexadecimal
string of symmetric cipher key
{string} algName
short/long algorithm name for encryption/decryption (OPTION)
{object} param
parameters for synchronous cipher such as initial vector (OPTION)
Since:
jsrsasign 6.2.0 crypto 1.1.10
Returns:
{string} hexadecimal encrypted string

© 2012-2023 Kenji Urushima, All rights reserved
Documentation generated by JsDoc Toolkit 2.4.0