REPORT Z_LOWERCASE_HTTP_SCRAMBLE. data: conv type ref to cl_abap_conv_out_ce, buffer type xstring, x4(4) type x, y4(4) type x, x type x, i type i, mask(4) type x value '0000003F', dest(100) type x, lf type f. data: stab(64) type x value 'F0ED53B83244F1F876C67959FD4F13A2' & 'C15195EC5483C234774943A27DE26596' & '5E5398789A17A33CD383A8B829FBDCA5' & '55D702778413ACDDF9B83116610E6DFA'. data: sourcelen type i, key type i, source type string, destination type c LENGTH 100. sourcelen = 5. key = 26101957. source = 'sifre'. if sourcelen eq 0. exit. endif. y4 = key. x4 = key * 2. y4 = y4 bit-xor x4. x4 = key / 32. y4 = y4 bit-xor x4. y4 = y4 bit-and mask. conv = cl_abap_conv_out_ce=>create( encoding = 'UTF-8' ). call method conv->write( data = source ). buffer = conv->get_buffer( ). i = 0. do sourcelen times. if sy-index eq 40. x4 = 1. endif. lf = ( key * i * i - i ) mod 256. x = lf. x = stab+y4(1) bit-xor x. dest+i = buffer+i(1) bit-xor x. i = i + 1. y4 = y4 + 1. y4 = y4 bit-and mask. enddo. write dest(sourcelen) to destination. write destination.
Leave a Reply