Application Development and Automation 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: 
Read only

Encrypt string using unique keyword

sridhar_meesala
Active Contributor
0 Likes
1,457

Hello All,

We are calling an external website with a document number. For example 'https://testonline.com/docno=1234567'. Now we need to encrypt this document number using a unique key(this key would be shared with the other party so that they can use if for decryption) and use the encrypted value in the link.

Could you please let me know if there is any algorithm in ABAP which we can use to encrypt the document number using a unique key?

Also the third party is asking for details like Initialization Vector. Where can we get this IV from.

Thank you,
Sri

1 ACCEPTED SOLUTION
Read only

juan_suros
Contributor
0 Likes
694

SAP has an add-on module for internal data encryption, but it sounds like you are interested in commercial encryption standards.

I think you will need to install a commercial product like PGP on your client pc or SAP application server and write programs that call the software in those locations to transform files.

Initialization Vector sounds like a term specific to a kind of encryption. Ask which standard they are using.

There is a nice GUID generator in ABAP that you can use to generate unique values:

  DATA:

    guid   TYPE guid_32,

    o_err  TYPE REF TO cx_uuid_error,                   

    s_err  TYPE string.

  TRY.                                                    

      guid = cl_system_uuid=>create_uuid_c32_static( ).   

    CATCH cx_uuid_error INTO o_err.                       

      s_err = o_err->get_text( ).                         

  ENDTRY.

2 REPLIES 2
Read only

juan_suros
Contributor
0 Likes
695

SAP has an add-on module for internal data encryption, but it sounds like you are interested in commercial encryption standards.

I think you will need to install a commercial product like PGP on your client pc or SAP application server and write programs that call the software in those locations to transform files.

Initialization Vector sounds like a term specific to a kind of encryption. Ask which standard they are using.

There is a nice GUID generator in ABAP that you can use to generate unique values:

  DATA:

    guid   TYPE guid_32,

    o_err  TYPE REF TO cx_uuid_error,                   

    s_err  TYPE string.

  TRY.                                                    

      guid = cl_system_uuid=>create_uuid_c32_static( ).   

    CATCH cx_uuid_error INTO o_err.                       

      s_err = o_err->get_text( ).                         

  ENDTRY.

Read only

0 Likes
694

Hello,

The third party is using AES encryption algorithm. I tried with below code

lv_key = cl_sec_sxml_writer=>generate_key(  cl_sec_sxml_writer=>co_aes256_algorithm ).

output = cl_sec_sxml_writer=>hmac( key = lv_key input = input ).

but the other party is not able to decrypt it.

Please someone let me know if this is possible or if there is any other way we can ensure that the value is not shown in the URL when opening in the browser. I am using  CALL_BROWSER function module to call the URL.

Any help is highly appreciated.

Thanks,

Sri.

We used Base64 encoding. Closing the thread.