update enc iter
This commit is contained in:
parent
14f305adda
commit
d944260a97
@ -6,7 +6,7 @@ import {
|
|||||||
arrayBufferToHex,
|
arrayBufferToHex,
|
||||||
} from "./misc";
|
} from "./misc";
|
||||||
|
|
||||||
const DEFAULT_ITER = 10000;
|
const DEFAULT_ITER = 20000;
|
||||||
|
|
||||||
// base32.stringify(Buffer.from('Salted__'))
|
// base32.stringify(Buffer.from('Salted__'))
|
||||||
export const MAGIC_ENCRYPTED_PREFIX_BASE32 = "KNQWY5DFMRPV";
|
export const MAGIC_ENCRYPTED_PREFIX_BASE32 = "KNQWY5DFMRPV";
|
||||||
|
|||||||
@ -60,10 +60,10 @@ describe("Encryption tests", () => {
|
|||||||
);
|
);
|
||||||
|
|
||||||
// two command returns same result:
|
// two command returns same result:
|
||||||
// cat ./sometext.txt | openssl enc -p -aes-256-cbc -S 8302F586FAB491EC -pbkdf2 -iter 10000 -base64 -pass pass:somepassword
|
// cat ./sometext.txt | openssl enc -p -aes-256-cbc -S 8302F586FAB491EC -pbkdf2 -iter 20000 -base64 -pass pass:somepassword
|
||||||
// openssl enc -p -aes-256-cbc -S 8302F586FAB491EC -pbkdf2 -iter 10000 -base64 -pass pass:somepassword -in ./sometext.txt
|
// openssl enc -p -aes-256-cbc -S 8302F586FAB491EC -pbkdf2 -iter 20000 -base64 -pass pass:somepassword -in ./sometext.txt
|
||||||
const opensslBase64Res =
|
const opensslBase64Res =
|
||||||
"U2FsdGVkX1+DAvWG+rSR7MSa+yJav1zCE7SSXiBooqwI5Q+LMpIthpk/pXkLj+25";
|
"U2FsdGVkX1+DAvWG+rSR7BPXMnlvSSVGMdjsx7kE1CTH+28P+yAZRdDGgFWMGkMd";
|
||||||
// we output base32, so we need some transformation
|
// we output base32, so we need some transformation
|
||||||
const opensslBase32Res = base64ToBase32(opensslBase64Res);
|
const opensslBase32Res = base64ToBase32(opensslBase64Res);
|
||||||
|
|
||||||
@ -89,6 +89,8 @@ describe("Encryption tests", () => {
|
|||||||
await fs.readFileSync(path.join(testFolder, testFileName + ".enc"))
|
await fs.readFileSync(path.join(testFolder, testFileName + ".enc"))
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// openssl enc -p -aes-256-cbc -S 8302F586FAB491EC -pbkdf2 -iter 20000 -pass pass:somepassword -in mona_lisa/1374px-Mona_Lisa,_by_Leonardo_da_Vinci,_from_C2RMF_retouched.jpg -out mona_lisa/1374px-Mona_Lisa,_by_Leonardo_da_Vinci,_from_C2RMF_retouched.jpg.enc
|
||||||
|
|
||||||
expect(Buffer.from(enc).equals(Buffer.from(opensslArrBuf))).to.be.true;
|
expect(Buffer.from(enc).equals(Buffer.from(opensslArrBuf))).to.be.true;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@ -1,3 +1,3 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
version https://git-lfs.github.com/spec/v1
|
||||||
oid sha256:cf67abd791f1e230bce57dd47150f262424247cbefb8be16efcd57d13955576a
|
oid sha256:7687eaf60ed93f754b107dc86a437aa97fad7bedd40432171b08c22cded7b559
|
||||||
size 1141568
|
size 1141568
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user