|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stay one step ahead of the competition. Evaluate and give feedback
on some of the hottest web development tools on the market today.
Make your opinion heard! Click
Here
|
|
#1
|
|||
|
|||
|
hello all,
i encrypted a word 'dtovzm' using oracle obfuscation encrypt function and code is declare g_key RAW(32767) := Utl_Raw.Cast_To_Raw('12345678'); g_pad_chr VARCHAR2(6) := 'myson'; v_units NUMBER; v_decrypted VARCHAR2(32767); p_text VARCHAR2(32767); v_encrypted RAW(32767); v_text VARCHAR2(32767); BEGIN IF Length('dtovzm') Mod 4 > 0 THEN v_units := Trunc(Length('dtovzm')/8) + 1; p_text := RPAD('dtovzm', v_units * 8, g_pad_chr); END IF; Dbms_Obfuscation_Toolkit.DesEncrypt(input => Utl_Raw.Cast_To_Raw(p_text), key => g_key, encrypted_data => v_encrypted); Dbms_Obfuscation_Toolkit.DesDecrypt(input => v_encrypted, key => g_key, decrypted_data => v_decrypted); dbms_output.put_line(RTrim(Utl_Raw.Cast_To_Varchar2(v_decrypted), g_pad_chr)); END; / but ,by decrypting the word 'dtovzm' i am getting 'dtovz' only. here the the padding character is 'myson'. the word containg last letter 'm' is not decrypting ,please help me why it is not decrypting ....... you can post the reply to URL also. thank you ... |
|
#2
|
|||
|
|||
|
There is nothing wrong in your code, just take a look at this line that you have written at the end of your code:
dbms_output.put_line(RTrim(Utl_Raw.Cast_To_Varchar2(v_decrypted), g_pad_chr)); RTRIM (<c1>,<c2>) function takes two arguments, where c1 and c2 are character strings. This function returns c1 without any trailing characters that appear in c2. If no c2 character are triling character in c1, then c1 is returned unchanged. c2 defaults to a single space. now run this query: select RTRIM('dtovzm','myson') from dual / now store '######' to g_key_chr and then run your code. what you got !!!!!!!!!!! |
|
#3
|
|||
|
|||
|
Thank You
i got it....thank you..
![]() |
![]() |
| Viewing: Dev Shed Forums > Databases > Oracle Development > Urgent Help Needed.....! |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|