latest build
This commit is contained in:
@@ -1,15 +1,9 @@
|
||||
const { Crypto } = require("node-webcrypto-ossl");
|
||||
|
||||
const crypto = new Crypto();
|
||||
|
||||
|
||||
// this is from https://github.com/matrix-org/browser-encrypt-attachment
|
||||
// which is the library used by matrix-reack-sdk to encrypt and decrypt attachments
|
||||
// just dropped in node-webcrypto-ossl to replace window.crypto
|
||||
// and Buffer for base64 encoding/decoding instead of window.btoa/window.atob
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Encrypt an attachment.
|
||||
* @param {ArrayBuffer} plaintextBuffer The attachment data buffer.
|
||||
@@ -17,6 +11,10 @@ const crypto = new Crypto();
|
||||
* The object has a "data" key with an ArrayBuffer of encrypted data and an "info" key
|
||||
* with an object containing the info needed to decrypt the data.
|
||||
*/
|
||||
|
||||
const { Crypto } = require("node-webcrypto-ossl");
|
||||
const crypto = new Crypto();
|
||||
|
||||
function encryptAttachment(plaintextBuffer) {
|
||||
var cryptoKey; // The AES key object.
|
||||
var exportedKey; // The AES key exported as JWK.
|
||||
|
||||
Reference in New Issue
Block a user