Module: crypto/cfb

Requires

Methods

(static) decrypt(cipherfn, key, ciphertext, resync) → {Uint8Array}

This function decrypts a given ciphertext using the specified blockcipher

Parameters:
Name Type Description
cipherfn String

the algorithm cipher class to decrypt data in one block_size encryption, module:crypto/cipher.

key Uint8Array

Uint8Array representation of key to be used to decrypt the ciphertext. This will be passed to the cipherfn

ciphertext Uint8Array

to be decrypted

resync Boolean

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:

the plaintext data

Type
Uint8Array

(static) encrypt(prefixrandom, cipherfn, plaintext, key, resync) → {Uint8Array}

This function encrypts a given plaintext with the specified prefixrandom using the specified blockcipher

Parameters:
Name Type Description
prefixrandom Uint8Array

random bytes of block_size length to be used in prefixing the data

cipherfn String

the algorithm cipher class to encrypt data in one block_size encryption, module:crypto/cipher.

plaintext Uint8Array

data to be encrypted

key Uint8Array

key to be used to encrypt the plaintext. This will be passed to the cipherfn

resync Boolean

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:

encrypted data

Type
Uint8Array

(static) mdc(key, ciphertext) → {Uint8Array}

Decrypts the prefixed data for the Modification Detection Code (MDC) computation

Parameters:
Name Type Description
cipherfn.encrypt String

Cipher function to use,

key Uint8Array

Uint8Array representation of key to be used to check the mdc This will be passed to the cipherfn

ciphertext Uint8Array

The encrypted data

Source:
See:
  • module:crypto/cipher.
Returns:

plaintext Data of D(ciphertext) with blocksize length +2

Type
Uint8Array