to implement hashing in your given code below:Ī. How can hashing be safer than encryption?Ĥ. Then I am wondering what is the encryption packages used for then?ģ. You say use hashing for appliction or oracle passwords (I assume). Since they key can be any combination of letters and numbers how in the world can someone guess it? ALso are you assuming that someone goes in and know how to use the decrypt package to try to figure out what passwords are?Ģ. You say that the data is as safe as the key? Table create table t ( data varchar2(9), data_enc raw(16) ) So that it returns in fact a RAW select crypt( '012345678' ) from dual You will have to modify your routine create or replace function crypt( p_str in varchar2 ) return varchar2ĥ l_data := rpad( p_str, (trunc(length(p_str)/8)+1)*8, chr(0) ) Select text from user_source where name = 'CRYPT' order by line I don't think the code you show is exactly the code you are using? Just beware of the doubling in size - it is unavoidable if you want to use TEXT_IO however. V_ENCRYPT := utl_raw.cast_to_varchar2( hextoraw(:DECRYPT_FILE.TXT_ENC) ) Then, you can save the hex string safely. (your VARCHAR2 out parameter would need to be 2 times as long as the input string was!!!) when you assign the RAW to the varchar2 - it would do it in HEX. That utl raw call would turn the varchar2 into a RAW. :DECRYPT_FILE.TXT_ENC := utl_raw.cast_to_raw(V_ENCRYPT) I suggest your do_encrypt is coded like this: V_ONE_CHR := SUBSTR(:DECRYPT_FILE.TXT_ENC, i, 1) V_FILETYPE := TEXT_IO.FOPEN(V_Filename, 'w' ) įOR i IN 1.LENGTH(:DECRYPT_FILE.TXT_ENC) V_Filename := :DECRYPT_FILE.TXT_DIRECTORY || :DECRYPT_FILE.TXT_FILENAME V_INPUT := rpad( V_INPUT, (trunc(length(V_INPUT)/8)+1)*8, chr(0)) Īnd, procedure to save encrypt ascii file Here is my encrypt and decrypt procedure. I suspect when my from write to emcrypted ascii text file, it write ASC(15) to ASC(29) to same ascii text(black square box). I can encrypt the simple text and save it fine, but If I read the saved encrypt file to decrypt, it contained some broken decrypt string. I made a form to encrypt and decrypt text string (more than 4000 Chr long).īasically, I have to read a encrypted text file and decrypt from that file, and also have read simple text file and encrypt the file before sending it to client.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |