File tree Expand file tree Collapse file tree
blog/26-04-26/x509-certificates-in-js---encrypt-decrypt-data/ex Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -49,9 +49,32 @@ TypedArray.prototype.slice() : https://developer.mozilla.org/en-US/docs/Web
4949 console . log ( 'decrypted :' ) ;
5050 console . log ( txt ) ;
5151
52+ console . log ( ) ;
53+ console . log ( ) ;
5254
55+ } ) ( ) ;
56+
57+
58+ ( async ( ) => {
59+
60+ if ( enabled = 1 ) {
61+ console . log ( 'decrypt test' ) ;
62+ console . log ( ) ;
63+ var encrypted_b64 = 'dqeBcMIqEJy2E2z1ixpE98Dcnrp8r275UptzFMoeg7ZTYaZqSv4b' ;
64+ var encrypted = b64_blob ( encrypted_b64 ) ;
65+
66+ var key_b64 = 'QWC78FsU8wpP9KtQotZn1zLfm1qXKG6S/0rJDF5KVbk=' ;
67+ var key_blob = b64_blob ( key_b64 ) ;
68+
69+ var blob = await aesDecryptNode ( key_blob , encrypted ) ;
70+
71+ var txt = await blob . text ( ) ;
72+ console . log ( 'decrypted :' ) ;
73+ console . log ( txt ) ;
5374
54-
75+ } //enabled
76+
77+
5578} ) ( ) ;
5679
5780
You can’t perform that action at this time.
0 commit comments