##Cryptographic libraries for SAP XS Engine
In this example we use 2 cryptographic libraries to secure our communications.
Import the project and use folder libs: (important! these libs use a library called base64 included in project, don't forget this file)
$.import("CryptoExample.libs", "aesCrypt");
var aesCrypt = $.CryptoExample.libs.aesCrypt;
$.import("CryptoExample.libs", "SHA256");
var SHA256 = $.CryptoExample.libs.SHA256;
The code contains two libraries:
-
AES for encrypt and decrypt information (strings), you can see more information at:
Encrypt
aesCrypt.encrypt(input,"SecretKey",256);
Decrypt
aesCrypt.decrypt(encript,"SecretKey",256);
- SHA256 for encrypt strings (very useful when you need store passwords), you can see more information at: *https://es.wikipedia.org/wiki/SHA-2
Encrypt
SHA256.SHA256("SomeInput");