web stats
Mirth Community - View Single Post - AES Encryption Help
View Single Post
  #1  
Old 06-11-2019, 04:35 AM
taanil taanil is offline
Mirth Newb
 
Join Date: Jun 2018
Posts: 8
taanil is on a distinguished road
Default AES Encryption Help

I am trying to encrypt a received HL7 using AES Encryption and save this in DB.
Kindly help me to start !!.

Here is the flow which i want to achieve:
1. Through TCP Listener, i receive a HL7 message.
2. I convert to XML.
3. The XML needs to be encrypted using AES Encryption algorithm.
4. The encrypted XML need to be stored in DB.
Then, the client will access this encrypted XML message, decrypt it and use it further.

I only have this code reference to start with,

var msgStr = 'Hi, this is test for AES Encryption !!';
var key = 'my-password';

var encrypted = CryptoJS.AES.encrypt(msgStr, key);
logger.info(encrypted.toString());

var decrypted = CryptoJS.AES.decrypt(encrypted, key);
logger.info(decrypted.toString(CryptoJS.enc.Utf8)) ;

I get a error message, as,
ReferenceError: "CryptoJS" is not defined.
Reply With Quote