‎2007 Apr 04 1:46 PM
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.
‎2007 Apr 04 1:53 PM
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á
‎2007 Apr 04 1:55 PM
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
‎2007 Apr 04 2:06 PM
Thanks for the info
hi I have tried 'FIEB_PASSWORD_DECRYPT' but its not working.
pl help
‎2007 Apr 04 2:26 PM
Hi,
Try using methods encode_base64 and decode_base64 of class cl_http_utility.
Regards,
Dirk.
‎2007 Apr 04 2:11 PM
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