Posts

Showing posts with the label java

crypto-js angular encryption and java decryption

ANGULAR / JS::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::   encode (myString:  string ) {    // PROCESS    const  encodedWord  = CryptoJS.enc.Utf8. parse (myString);  // encodedWord Array object    const  encoded  = CryptoJS.enc.Base64. stringify ( encodedWord );  // string: 'NzUzMjI1NDE='    return  encoded ; } decode (encoded:  string ) {    // PROCESS    const  encodedWord  = CryptoJS.enc.Base64. parse (encoded);  // encodedWord via Base64.parse()    const  decoded  = CryptoJS.enc.Utf8. stringify ( encodedWord );  // decode encodedWord via Utf8.stringify() '75322541'    return  decoded ; } encryptTest (){    console . log ( 'crypto-js' , CryptoJS);    var  decryptedBase64Key  =  'mustbe16byteskey' ;    var  deparsedBase64Key  =...