- Source:
Requires
Methods
-
<static> decrypt(cipherfn, key, ciphertext, resync) → {String}
-
This function decrypts a given plaintext using the specified blockcipher to decrypt a message
Parameters:
Name Type Description cipherfnString the algorithm cipher class to decrypt data in one block_size encryption, module:crypto/cipher. keyString binary string representation of key to be used to decrypt the ciphertext. This will be passed to the cipherfn ciphertextString to be decrypted provided as a string resyncBoolean a boolean value specifying if a resync of the IV should be used or not. The encrypteddatapacket uses the "old" style with a resync. Decryption within an encryptedintegrityprotecteddata packet is not resyncing the IV. - Source:
Returns:
a string with the plaintext data- Type
- String
-
<static> encrypt(prefixrandom, cipherfn, plaintext, key, resync) → {String}
-
This function encrypts a given with the specified prefixrandom using the specified blockcipher to encrypt a message
Parameters:
Name Type Description prefixrandomString random bytes of block_size length provided as a string to be used in prefixing the data cipherfnString the algorithm cipher class to encrypt data in one block_size encryption, module:crypto/cipher. plaintextString data to be encrypted provided as a string keyString binary string representation of key to be used to encrypt the plaintext. This will be passed to the cipherfn resyncBoolean a boolean value specifying if a resync of the IV should be used or not. The encrypteddatapacket uses the "old" style with a resync. Encryption within an encryptedintegrityprotecteddata packet is not resyncing the IV. - Source:
Returns:
a string with the encrypted data- Type
- String
-
<static> mdc(key, ciphertext) → {String}
-
Decrypts the prefixed data for the Modification Detection Code (MDC) computation
Parameters:
Name Type Description cipherfn.encryptString Cipher function to use, keyString binary string representation of key to be used to check the mdc This will be passed to the cipherfn ciphertextString The encrypted data - Source:
- See:
-
- module:crypto/cipher.
Returns:
plaintext Data of D(ciphertext) with blocksize length +2- Type
- String