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

Data encryption

Former Member
0 Likes
740

I have a scenario where in I want to update some data in to the table in encryption format and again while displaying in the report in want to decrypt the same.

If any one has such kind of program can you please let me know.

Thanks in advance.

5 REPLIES 5
Read only

Former Member
0 Likes
658

Hi!

You might try out for encryption the following function elements:

FIEB_PASSWORD_DECRYPT

FIEB_PASSWORD_ENCRYPT

You can write an automatic field conversion into the DOMAIN of the field. Domains can be located in SE11 transaction.

For example: CONVERSION_EXIT_XXXXX_INPUT, CONVERSION_EXIT_XXXXX_OUTPUT

And assign the XXXXX code into your domain.

Regarsd

Tamá

Read only

Former Member
0 Likes
658

hi ps

use the followimg fms

FIEB_PASSWORD_ENCRYPT and

FIEB_PASSWORD_DECRYPT are Function modules which does the same.

sample code is as shown

REPORT EN_DECRYPT_TEST.

*

Data enpwd(32) type c.

parameter pwd like enpwd .

                • Encrypting *******************

CALL FUNCTION 'FIEB_PASSWORD_ENCRYPT'

EXPORTING

IM_DECRYPTED_PASSWORD = pwd

IMPORTING

EX_ENCRYPTED_PASSWORD = enpwd

.

                • Decrypting *******************

CALL FUNCTION 'FIEB_PASSWORD_DECRYPT'

EXPORTING

IM_ENCRYPTED_PASSWORD = enpwd

IMPORTING

EX_DECRYPTED_PASSWORD = pwd

.

                  • Output **********************

write:/ 'Encrypt data=', enpwd,

/ 'Decrypt data=', pwd.

regards

navjot

reward points if helpfull

Read only

0 Likes
658

Thanks for the info

hi I have tried 'FIEB_PASSWORD_DECRYPT' but its not working.

pl help

Read only

0 Likes
658

Hi,

Try using methods encode_base64 and decode_base64 of class cl_http_utility.

Regards,

Dirk.

Read only

Former Member
0 Likes
658

Hai,

You can encript the data as follows(A Simple scenario):

loop at itab.

for each character add some value(let it be 26)

endloop.

You can decript the data as follows:

loop at itab.

for each character subtract tha same value( 26)

endloop.

If want to encript such that nobody can understand,i am giving the code in C Lanhuage as below:

void encipher(unsigned long *const v,unsigned long *const w,

const unsigned long *const k)

{

register unsigned long y=v[0],z=v[1],sum=0,delta=0x9E3779B9,

a=k[0],b=k[1],c=k[2],d=k[3],n=32;

while(n-->0)

{

sum += delta;

y = (z << 4)a ^ zsum ^ (z >> 5)b;

z = (y << 4)c ^ ysum ^ (y >> 5)d;

}

w[0]=y; w[1]=z;

}

void decipher(unsigned long *const v,unsigned long *const w,

const unsigned long *const k)

{

register unsigned long y=v[0],z=v[1],sum=0xC6EF3720,

delta=0x9E3779B9,a=k[0],b=k[1],

c=k[2],d=k[3],n=32;

/* sum = delta<<5, in general sum = delta * n */

while(n-->0)

{

z -= (y << 4)c ^ ysum ^ (y >> 5)+d;

y -= (z << 4)a ^ zsum ^ (z >> 5)+b;

sum -= delta;

}

w[0]=y; w[1]=z;

}

I hope you got needed help.

<b>Reward points if it helps you.</b>

Regds,

Rama.Pammi