How to use the @liskhq/lisk-cryptography.decryptMessageWithPassphrase function in @liskhq/lisk-cryptography

To help you get started, we’ve selected a few @liskhq/lisk-cryptography examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github LiskHQ / lisk-sdk / test / utils / cryptography.ts View on Github external
it('should call decryptMessageWithPassphrase', () => {
			cryptography.decryptMessage(input);
			return expect(
				cryptographyModule.decryptMessageWithPassphrase,
			).to.be.calledWithExactly(
				input.cipher,
				input.nonce,
				input.passphrase,
				input.senderPublicKey,
			);
		});
github LiskHQ / lisk-sdk / commander / src / utils / cryptography.ts View on Github external
export const decryptMessage = ({
	cipher,
	nonce,
	passphrase,
	senderPublicKey,
}: DecryptMessageInputs) => ({
	message: cryptography.decryptMessageWithPassphrase(
		cipher,
		nonce,
		passphrase,
		senderPublicKey,
	),
});
github LiskHQ / lisk-sdk / commander / src / commands / message / decrypt.ts View on Github external
) => ({ passphrase, data }: InputFromSourceOutput) => {
	const targetMessage = message || data;
	if (!targetMessage) {
		throw new ValidationError('No message was provided.');
	}
	if (!passphrase) {
		throw new ValidationError('No passphrase was provided.');
	}

	return decryptMessageWithPassphrase(
		targetMessage,
		nonce,
		passphrase,
		senderPublicKey,
	);
};