@burstjs/crypto
Advanced tools
Comparing version 0.5.0-beta.11 to 0.5.0-beta.12
{ | ||
"name": "@burstjs/crypto", | ||
"version": "0.5.0-beta.11", | ||
"version": "0.5.0-beta.12", | ||
"description": "Cryptographic functions for building Burstcoin apps.", | ||
@@ -59,3 +59,3 @@ "contributors": [ | ||
}, | ||
"gitHead": "70994f5d94a08cf00c8324784328abea5e688a79", | ||
"gitHead": "ce099787f81cc0c49e1ad0cdbbed931485bfa2e5", | ||
"publishConfig": { | ||
@@ -62,0 +62,0 @@ "access": "public" |
@@ -92,2 +92,30 @@ import {generateMasterKeys} from '../generateMasterKeys'; | ||
it('should decrypt a text message successfully as owner of message', () => { | ||
const recipientKeys = generateMasterKeys('testSecret_Recipient'); | ||
const senderKeys = generateMasterKeys('testSecret_Sender'); | ||
// german umlauts to proof UTF-8 | ||
const originalMessage = `Die Burstcoin-Blockchain ist ein öffentliches Hauptbuch, | ||
das jede Transaktion aufzeichnet. Es ist vollständig verteilt und funktioniert | ||
ohne eine zentrale vertrauenswürdige Instanz: | ||
Die Blockchain wird von einem Netzwerk von Computern verwaltet, | ||
die als Knoten bezeichnet werden und die Burstcoin-Software ausführen.`; | ||
const encrypted = encryptMessage( | ||
originalMessage, | ||
recipientKeys.publicKey, | ||
senderKeys.agreementPrivateKey | ||
); | ||
const message = decryptMessage( | ||
encrypted, | ||
recipientKeys.publicKey, | ||
senderKeys.agreementPrivateKey | ||
); | ||
expect(message).toEqual(originalMessage); | ||
}); | ||
it('should decrypt a text message sent with BRS successfully', () => { | ||
@@ -94,0 +122,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1826554
20931