Constructors
Private
constructor
- new PCDCrypto(sodium): PCDCrypto
Properties
Private
sodium
sodium: __module
Methods
argon2
- argon2(password, salt, length?): string
Parameters
- password: string
- salt: string
- length: number = 32
Returns string
cryptoHash
- cryptoHash(str): string
Returns string
generateRandomKey
- generateRandomKey(bits?): string
Returns string
generateSalt
- generateSalt(length?): string
Returns string
generateSaltAndEncryptionKey
- generateSaltAndEncryptionKey(password): {
key: string;
salt: string;
} Returns {
key: string;
salt: string;
}
randombytesDeterministic
- randombytesDeterministic(length, seed): null | Uint8Array
Parameters
- length: number
- seed: Uint8Array
Returns null | Uint8Array
xchacha20Decrypt
- xchacha20Decrypt(ciphertext, nonce, key, assocData?): null | string
Parameters
- ciphertext: string
- nonce: string
- key: string
Optional
assocData: string | Uint8Array
Returns null | string
xchacha20Encrypt
- xchacha20Encrypt(plaintext, nonce, key, assocData?): string
Parameters
- plaintext: string
- nonce: string
- key: string
Optional
assocData: string
Returns string
Static
newInstance
- newInstance(sodium?): Promise<PCDCrypto>
Parameters
Optional
sodium: __module
This class contains cryptographic primitives that are used by the PCD application SDK and downstream packages.