Skip to Content
Author's profile photo Enric Castella Gonzalez

Cryptographic libraries for SAP HANA XS engine

Hello everyone,

After a period of inactivity, I bring you a couple of very useful libraries for SAP HANA XS engine.

One of our applications requires that certain information is transmitted securely between SAP UI5 and SAP cloud platform through SHA256 and AES.

 

In the following link we can see find an example importable project https://github.com/enric11/SAPXSHanaCryptographic

You can import the project and execute the file test.xsjs

 

As a summary:

AES will allow us to encrypt texts or objects by private key so that we can transmit information. This information may be encrypted or decrypted.

*https://en.wikipedia.org/wiki/Advanced_Encryption_Standard

var input = "Hello!";

/* encrypt */
var encript = aesCrypt.encrypt(input,"SecretKey",256);

/* decrypt */
aesCrypt.decrypt(encript,"SecretKey",256);

 

SHA256 is a very useful encryption to save information as passwords, this information can only be encrypted with what is very useful to verify if a chain of strings is valid or not.

*https://es.wikipedia.org/wiki/SHA-2

SHA256.SHA256("SomeInput");

 

Best regards

Assigned Tags

      1 Comment
      You must be Logged on to comment or reply to a post.
      Author's profile photo Daniela Betancourt
      Daniela Betancourt

      You can also use the built in function of xsjs

      https://help.sap.com/doc/3de842783af24336b6305a3c0223a369/2.0.01/en-US/$.security.crypto.html

      var hashedData=$.util.codec.encodeBase64($.security.crypto.sha256("data"));