SlideShare a Scribd company logo
By Anirban Sen Chowdhary
Encrypting/Decrypting  mule
.
Fortunately we have base64-encoder-transformer and base64-
decoder-transformer available in our Mule
So, to encrypt a payload in our Mule flow, we can use
base64-encoder-transformer as follows :-
As you can see we have used a file inbound to pick a file in our flow,
and then we encrypt it with base64-encoder-transformer and the
output of the flow will produce a encrypted file
Our corresponding Mule flow will be as follows :-
<flow name="encryptFlow1" doc:name="encryptFlow1">
<file:inbound-endpoint path="E:backuptest"
responseTimeout="10000" doc:name="File">
<file:filename-regex-filter pattern="abc.doc"
caseSensitive="false" />
</file:inbound-endpoint>
<base64-encoder-transformer encoding="utf8" />
<logger level="INFO" message="#[message.payloadAs(java.lang.String)]" />
<file:outbound-endpoint path="E:backuptestnewfolder"
responseTimeout="10000" doc:name="File" />
</flow>
As you can see in the code it will pick a file called abc.doc from
E:backuptest location , encrypt it and put the encrypted file to
E:backuptestnewfolder
So, let us place a file abc.doc in the source folder as follows :-
Let run our application and we can see, the file has been
transferred to location E:backuptestnewfolder
Now, this transferred file is an encrypted file
We can see our compressed file here in location
E:backuptestnewfolder :-
Now if we open the file abc.doc in E:backuptestnewfolder
we will find the content of the file is in encrypted form as
follows:-
Now what about decrypting the file back to the original content
???
In case of decrypting a file back to original content ( content
before the encryption) we will be using base64-decoder-
transformer as follows:-
As you can see, it will pick up the encrypted file abc.doc from the
location E:backuptestnewfolder and put it into a new location
E:backuptestoriginalFile
The corresponding our Mule flow will be :-
<flow name="decrypt">
<file:inbound-endpoint path="E:backuptestnewfolder"
responseTimeout="10000" doc:name="File">
<file:filename-regex-filter pattern="abc.doc"
caseSensitive="false" />
</file:inbound-endpoint>
<base64-decoder-transformer encoding="utf8" />
<file:outbound-endpoint path="E:backuptestoriginalFile"
responseTimeout="10000" doc:name="File" />
</flow>
Now if we run the flow, we will get the following in our console :-
The file has been decrypted back to it’s original content into the
location E:backuptestoriginalFile
Now if we open the decrypted file we will get a normal content:-
Hope you enjoyed the tips of compressing and decompressing using
base64-encoder-transformer/base64-decoder-transformer in Mule
Next slide I will bring some more simple yet interesting topic
Encrypting/Decrypting  mule

More Related Content

PPTX
Mulesoft Using Groovy Component
PPTX
Compress and decompress
PPTX
Compressing & decompressing in mule
PPTX
Mule message enricher
PPTX
Groovy example in mule
PDF
MuleSoft ESB Message Enricher
PPTX
Cache for community edition
PPTX
Simple groovy example in mule
Mulesoft Using Groovy Component
Compress and decompress
Compressing & decompressing in mule
Mule message enricher
Groovy example in mule
MuleSoft ESB Message Enricher
Cache for community edition
Simple groovy example in mule

What's hot (15)

PPTX
Caching & validating
PPTX
Accessing Mule variables in groovy
PPTX
Parameters as a part of body
PPTX
Input and output flow using http and java component
PPTX
Stored procedure in Mule
PPTX
Using message enricher
PPTX
Mule esb How to convert from CSV to Json in 5 minutes
PPTX
Caching and invalidating with managed store
PPTX
Mule Esb Data Weave
PPTX
Caching and invalidating with managed store
PPTX
Mule esb :Data Weave
PPTX
Groovy in Mule
PPTX
Send email attachment using smtp in mule esb
PPTX
Groovy with Mule
PPTX
Integration with Dropbox using Mule ESB
Caching & validating
Accessing Mule variables in groovy
Parameters as a part of body
Input and output flow using http and java component
Stored procedure in Mule
Using message enricher
Mule esb How to convert from CSV to Json in 5 minutes
Caching and invalidating with managed store
Mule Esb Data Weave
Caching and invalidating with managed store
Mule esb :Data Weave
Groovy in Mule
Send email attachment using smtp in mule esb
Groovy with Mule
Integration with Dropbox using Mule ESB
Ad

Viewers also liked (9)

PPTX
Mule new jdbc component
PPTX
Calling database with groovy in mule
PPTX
Basic example using file connector in anypoint studio
PPTX
Cloudhub in action
PPTX
RAMLing around with mule part2
PPTX
Idempotent filter with simple file
PPTX
Mule MMC as a service
PPTX
Basic example using vm component
PPTX
VM example in mule
Mule new jdbc component
Calling database with groovy in mule
Basic example using file connector in anypoint studio
Cloudhub in action
RAMLing around with mule part2
Idempotent filter with simple file
Mule MMC as a service
Basic example using vm component
VM example in mule
Ad

More from Anirban Sen Chowdhary (20)

PPTX
Change the game with Game changer
PPTX
Ring central desktop app overview
PPTX
Overview in ringcentral digital line
PPTX
Some basics with ring central
PPTX
Ring central and python
PPTX
RingCentral application development overview
PPTX
Cloze connect ringcentral
PPTX
Overview on ring central errors part 4
PPTX
Setting up your ring central sandbox in steps
PPTX
Overview on ring central errors: part 2
PPTX
Overview on ring central errors
PPTX
Call recording overview ring central
PPTX
Ring central engaging with amazon alexa
PPTX
How ring central sdk changing the game
PPTX
When ring central connect salesforce
PPTX
Mule 4 connecting ring central
PPTX
Ring central sdk
PPTX
Ring central with okta
PPTX
Ring central connecting salesforce overview
PPTX
Ring central call logs overview (part 2)
Change the game with Game changer
Ring central desktop app overview
Overview in ringcentral digital line
Some basics with ring central
Ring central and python
RingCentral application development overview
Cloze connect ringcentral
Overview on ring central errors part 4
Setting up your ring central sandbox in steps
Overview on ring central errors: part 2
Overview on ring central errors
Call recording overview ring central
Ring central engaging with amazon alexa
How ring central sdk changing the game
When ring central connect salesforce
Mule 4 connecting ring central
Ring central sdk
Ring central with okta
Ring central connecting salesforce overview
Ring central call logs overview (part 2)

Recently uploaded (20)

PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
Electronic commerce courselecture one. Pdf
PDF
KodekX | Application Modernization Development
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PPTX
Spectroscopy.pptx food analysis technology
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
Unlocking AI with Model Context Protocol (MCP)
PPTX
Programs and apps: productivity, graphics, security and other tools
DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
Encapsulation theory and applications.pdf
PPTX
Big Data Technologies - Introduction.pptx
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PDF
Approach and Philosophy of On baking technology
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
Chapter 3 Spatial Domain Image Processing.pdf
Electronic commerce courselecture one. Pdf
KodekX | Application Modernization Development
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Mobile App Security Testing_ A Comprehensive Guide.pdf
Spectroscopy.pptx food analysis technology
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Unlocking AI with Model Context Protocol (MCP)
Programs and apps: productivity, graphics, security and other tools
The AUB Centre for AI in Media Proposal.docx
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Encapsulation theory and applications.pdf
Big Data Technologies - Introduction.pptx
MIND Revenue Release Quarter 2 2025 Press Release
Approach and Philosophy of On baking technology

Encrypting/Decrypting mule

  • 1. By Anirban Sen Chowdhary
  • 3. .
  • 4. Fortunately we have base64-encoder-transformer and base64- decoder-transformer available in our Mule
  • 5. So, to encrypt a payload in our Mule flow, we can use base64-encoder-transformer as follows :- As you can see we have used a file inbound to pick a file in our flow, and then we encrypt it with base64-encoder-transformer and the output of the flow will produce a encrypted file
  • 6. Our corresponding Mule flow will be as follows :- <flow name="encryptFlow1" doc:name="encryptFlow1"> <file:inbound-endpoint path="E:backuptest" responseTimeout="10000" doc:name="File"> <file:filename-regex-filter pattern="abc.doc" caseSensitive="false" /> </file:inbound-endpoint> <base64-encoder-transformer encoding="utf8" /> <logger level="INFO" message="#[message.payloadAs(java.lang.String)]" /> <file:outbound-endpoint path="E:backuptestnewfolder" responseTimeout="10000" doc:name="File" /> </flow>
  • 7. As you can see in the code it will pick a file called abc.doc from E:backuptest location , encrypt it and put the encrypted file to E:backuptestnewfolder So, let us place a file abc.doc in the source folder as follows :-
  • 8. Let run our application and we can see, the file has been transferred to location E:backuptestnewfolder Now, this transferred file is an encrypted file
  • 9. We can see our compressed file here in location E:backuptestnewfolder :-
  • 10. Now if we open the file abc.doc in E:backuptestnewfolder we will find the content of the file is in encrypted form as follows:-
  • 11. Now what about decrypting the file back to the original content ???
  • 12. In case of decrypting a file back to original content ( content before the encryption) we will be using base64-decoder- transformer as follows:- As you can see, it will pick up the encrypted file abc.doc from the location E:backuptestnewfolder and put it into a new location E:backuptestoriginalFile
  • 13. The corresponding our Mule flow will be :- <flow name="decrypt"> <file:inbound-endpoint path="E:backuptestnewfolder" responseTimeout="10000" doc:name="File"> <file:filename-regex-filter pattern="abc.doc" caseSensitive="false" /> </file:inbound-endpoint> <base64-decoder-transformer encoding="utf8" /> <file:outbound-endpoint path="E:backuptestoriginalFile" responseTimeout="10000" doc:name="File" /> </flow>
  • 14. Now if we run the flow, we will get the following in our console :- The file has been decrypted back to it’s original content into the location E:backuptestoriginalFile
  • 15. Now if we open the decrypted file we will get a normal content:-
  • 16. Hope you enjoyed the tips of compressing and decompressing using base64-encoder-transformer/base64-decoder-transformer in Mule Next slide I will bring some more simple yet interesting topic