web stats
AES Encryption Help - Mirth Community

Go Back   Mirth Community > Mirth Connect > Support

Reply
 
Thread Tools Display Modes
  #1  
Old 06-11-2019, 04:35 AM
taanil taanil is offline
Mirth Newb
 
Join Date: Jun 2018
Posts: 10
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
  #2  
Old 06-11-2019, 11:37 AM
agermano agermano is offline
Mirth Guru
 
Join Date: Apr 2017
Location: Indiana, USA
Posts: 964
agermano is on a distinguished road
Default

CryptoJS is not included with Mirth. If you want to add third-party javascript libraries, you should put them in a Code Template, and associate the template with your channel.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -8. The time now is 02:07 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2019, vBulletin Solutions, Inc.
Mirth Corporation