Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

AES encryption using ABAP FMs or class methods

former_member188019
Active Participant
0 Kudos

I am trying to encrypt a string data using AES 128 method.

in java, I could use

SampleEncryptDecrypt oSed = new SampleEncryptDecrypt();

//byte[] key = oSed.generateKey(128);

String str1 = "1111111111111111"; //sample key

byte[] key = str1.getBytes();

System.out.println("Key:" + new String(key));

byte[] encryptedData = oSed.encryptData("MyText", key);

System.out.println("encryptedData: " + new String(encryptedData));

String decryptedData =  oSed.decryptData(key, encryptedData);

System.out.println("decryptedData:" + decryptedData);

the output is something like:

Key:1111111111111111

encryptedData: ¼+\žÉP³…讘JLÏ#Þ

decryptedData: MyText

are there any FMs or class methods in ABAP, that we can use to encrypt using AES 128 algorithm.

I checked in scn, but could not find easy way/sample programs.

thanks

Madhu_1980

3 REPLIES 3

Former Member
0 Kudos

I wrote some code before, hope it helps:

Sumu-Ning/AES · GitHub

cris_hansen
Advisor
Advisor
0 Kudos

Hello Madhu,

I suggest reading the following documents:

The standard algorithm used by SSF is configured by ssf/ssf_symencr_alg but you also can pass it as parameter to the envelope function module.

Be sure to use a recent SAPCRYPTOLIB patch level, so AES is technically possible.

Regards,

Cris

0 Kudos

The SSF libray as documented here is only suited to Document handling and doesnt provide direct aes encryption and descrption.

Still look for call

encrypted_text   =   Encrypt( algorithm, mode, string, key ) 

AES-GCM ideally but AES-CBM is better than nothing


does any body know how to call this in ABAP ?