![]() |
|
Welcome to the Computer Webmaster Gaming Console Graphics Forum forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact contact us. |
| |||||||
| Database Database problems or need to ask a question? maybe something to do with sql injections or a database software question. Database topics cover MySQL, PostgreSQL, Oracle, SQL Server or anything else related to databases. |
![]() |
| | LinkBack | Thread Tools | Display Modes |
| | #1 | ||
| Member Level 3 | here is a simple program is wrote for one of my projects to encript data in Oracle. create or replace function estring(p_var varchar2) return varchar2 is v_estr varchar2(255); v_elength number; ipos number; xor number; begin --Ensure password IS NOT case-sensitive p_var := lower(p_var); --Only encrypt IF parameter IS NOT NULL if p_var is not null then v_elength := length(p_var); -- CREATE the KEY using a combination the the lenth OF the password + the pos of the 3rd char found in the PW. xor := v_elength + instr(p_var, substr(p_var, 3, 1)); ipos := 1; v_estr := ''; while ipos <= v_elength loop v_estr := v_str || to_char(to_ascii(substr(p_var, ipos, 1)) ^ xor); ipos := ipos + 1; end loop; return(v_estr); else v_estr := null; return(v_estr); end if; end estring | ||
| | |
| Advertisements |
| | #2 | ||
| Member Level 3 | Hi, this is a good function, however i do have a question in mind about v_estr := v_str || to_char(to_ascii(substr(p_var, ipos, 1)) ^ xor); would you please explain this line? | ||
| | |
| Featured Websites | ||||
|
![]() |
| Tags: encription, oracle |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Encription in mysql | eric | Database | 2 | 07-16-2006 5:49 AM |
| Featured Websites | ||||
|