Class KJUR.crypto.Cipher
Cipher class to encrypt and decrypt data
Defined in: crypto-1.1.js.
Constructor Attributes | Constructor Name and Description |
---|---|
KJUR.crypto.Cipher(params)
Cipher class to encrypt and decrypt data
Here is supported canonicalized cipher algorithm names and its standard names:
|
Method Attributes | Method Name and Description |
---|---|
<static> |
KJUR.crypto.Cipher.decrypt(hex, keyObj, algName)
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, keyObj, algName)
encrypt raw string by specified key and algorithm
This static method encrypts raw string with specified key and algorithm. |
<static> |
KJUR.crypto.Cipher.getAlgByKeyAndName(keyObj, algName)
get canonicalized encrypt/decrypt algorithm name by key and short/long algorithm name
Here is supported canonicalized cipher algorithm names and its standard names:
|
Class Detail
KJUR.crypto.Cipher(params)
Cipher class to encrypt and decrypt data
Here is supported canonicalized cipher algorithm names and its standard names:
Currently this class supports only RSA encryption and decryption based on RSAES-OAEP and RSAES-PKCS1-v1_5 scheme. However it is planning to implement also symmetric ciphers near in the future
Here is supported canonicalized cipher algorithm names and its standard names:
- RSA - RSA/ECB/PKCS1Padding (default for RSAKey)
- RSAOAEP - RSA/ECB/OAEPWithSHA-1AndMGF1Padding
- RSAOAEP224 - RSA/ECB/OAEPWithSHA-224AndMGF1Padding(*)
- RSAOAEP256 - RSA/ECB/OAEPWithSHA-256AndMGF1Padding
- RSAOAEP384 - RSA/ECB/OAEPWithSHA-384AndMGF1Padding(*)
- RSAOAEP512 - RSA/ECB/OAEPWithSHA-512AndMGF1Padding(*)
Currently this class supports only RSA encryption and decryption based on RSAES-OAEP and RSAES-PKCS1-v1_5 scheme. However it is planning to implement also symmetric ciphers near in the future
- Parameters:
- {Array} params
- parameters for constructor
- Since:
- jsrsasign 6.2.0 crypto 1.1.10
Method Detail
<static>
{String}
KJUR.crypto.Cipher.decrypt(hex, keyObj, algName)
decrypt encrypted hexadecimal string with specified key and algorithm
This static method decrypts encrypted hexadecimal string with specified key and algorithm.
This static method decrypts encrypted hexadecimal string with specified key and algorithm.
KJUR.crypto.Cipher.decrypt("aaa", prvRSAKeyObj) → "1abc2d..." KJUR.crypto.Cipher.decrypt("aaa", prvRSAKeyObj, "RSAOAEP) → "23ab02..."
- Parameters:
- {String} hex
- hexadecial string of encrypted message
- {Object} keyObj
- RSAKey object or hexadecimal string of symmetric cipher key
- {String} algName
- short/long algorithm name for encryption/decryption
- Since:
- jsrsasign 6.2.0 crypto 1.1.10
- Returns:
- {String} decrypted raw string
<static>
{String}
KJUR.crypto.Cipher.encrypt(s, keyObj, algName)
encrypt raw string by specified key and algorithm
This static method encrypts raw string with specified key and algorithm.
This static method encrypts raw string with specified key and algorithm.
KJUR.crypto.Cipher.encrypt("aaa", pubRSAKeyObj) → "1abc2d..." KJUR.crypto.Cipher.encrypt("aaa", pubRSAKeyObj, "RSAOAEP") → "23ab02..."
- Parameters:
- {String} s
- input string to encrypt
- {Object} keyObj
- RSAKey object or hexadecimal string of symmetric cipher key
- {String} algName
- short/long algorithm name for encryption/decryption
- Since:
- jsrsasign 6.2.0 crypto 1.1.10
- Returns:
- {String} hexadecimal encrypted string
<static>
{String}
KJUR.crypto.Cipher.getAlgByKeyAndName(keyObj, algName)
get canonicalized encrypt/decrypt algorithm name by key and short/long algorithm name
Here is supported canonicalized cipher algorithm names and its standard names:
Here is supported canonicalized cipher algorithm names and its standard names:
- RSA - RSA/ECB/PKCS1Padding (default for RSAKey)
- RSAOAEP - RSA/ECB/OAEPWithSHA-1AndMGF1Padding
- RSAOAEP224 - RSA/ECB/OAEPWithSHA-224AndMGF1Padding(*)
- RSAOAEP256 - RSA/ECB/OAEPWithSHA-256AndMGF1Padding
- RSAOAEP384 - RSA/ECB/OAEPWithSHA-384AndMGF1Padding(*)
- RSAOAEP512 - RSA/ECB/OAEPWithSHA-512AndMGF1Padding(*)
KJUR.crypto.Cipher.getAlgByKeyAndName(objRSAKey) → "RSA" KJUR.crypto.Cipher.getAlgByKeyAndName(objRSAKey, "RSAOAEP") → "RSAOAEP"
- Parameters:
- {Object} keyObj
- RSAKey object or hexadecimal string of symmetric cipher key
- {String} algName
- short/long algorithm name for encryption/decryption
- Since:
- jsrsasign 6.2.0 crypto 1.1.10
- Returns:
- {String} canonicalized algorithm name for encryption/decryption