Reputation: 67
Is there a way or a function in xslt by which we can encrypt and decrypt the password. For example in my case. encypted format(where the plain text is not visible to anyone .. and its is replaced by some random alphanumeric value)
i created a xslt file mentioned below and i am using the credentials from this file in my OSB service But the requirement it instead of plain text this password needs to be in encrypted format and then i have to decrypt it in my code when i use it Is there any way to do it using xslt or custom template or xpath function
<xsl:template match="/">
<aut:AutenticateRequest xmlns:aut="http://****/xsd/authenticate">
<aut:username>xyz</aut:username>
<aut:password>abcdef</aut:password>
<aut:uinqueMachineID></aut:uinqueMachineID>
</aut:AutenticateRequest>
</xsl:template>
Upvotes: 0
Views: 363
Reputation: 163262
There's a general principle in security that you should never try to implement encryption yourself - even if you implement the best algorithms, you are likely get it wrong. Always use carefully tested encryption library code.
XSLT 1.0 does not have any standard functions for encryption and decryption in its function library (and in fact, neither do later versions). So this implies that you will have to call out to another language such as C#, Java, or JS -- which is something that most XSLT processors allow, though the details vary from one processor to another.
Upvotes: 1