- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Script using encrypt and decrypt.
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-11-2006 08:27 PM
05-11-2006 08:27 PM
I need your assistance in this.
We have a table with passwords that are encrypted.
Now I have to send this tbale values in an ascii file to a target location. As the source and target rdbms are different, I will have to write a script to decrypt the values that I extract then encrypt tehm again using encrypt function with a key and send the key to the target and they decrypt with decrypt function. I know using crypt, but I want a solution using encrypt and decrypt.
Thanks
I A
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-11-2006 08:52 PM
05-11-2006 08:52 PM
Re: Script using encrypt and decrypt.
I have attached the function definitions we use. Please change the KEYPHRASE. You can modify to :
select decrypt(pwd_col) from pwd_table
Then use the cleartext to encrypt on the other side:
update pwd_table set pwd_col = encrypt(pwd);
Hope this helps as an oracle solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-12-2006 04:56 PM
05-12-2006 04:56 PM
Re: Script using encrypt and decrypt.
can you please check this one?
create or replace function crypt( p_str in varchar2 )
return raw
as
l_data varchar2(255);
begin
l_data := rpad( p_str, (trunc(length(p_str)/8)+1)*8, chr(0) );
return dbms_obfuscation_toolkit.DESEncrypt
( input => utl_raw.cast_to_raw(l_data),
key => utl_raw.cast_to_raw('MagicKey-Yogeeraj') );
end;
/
create or replace function decrypt( p_str in raw ) return varchar2
as
begin
return utl_raw.cast_to_varchar2(
dbms_obfuscation_toolkit.DESdecrypt
( input => p_str,
key => utl_raw.cast_to_raw('MagicKey-Yogeeraj') ) );
end;
/
Below an example on how you should go about in retrieving the real data:
column data format a10
yd@MYDB.MU> column data format a10
yd@MYDB.MU> create table t ( data varchar2(9), data_enc raw(16) );
Table created.
Elapsed: 00:00:03.12
yd@MYDB.MU> yd@PFS.CMT.MU>
yd@MYDB.MU> insert into t values ( '012345678',crypt('012345678'));
1 row created.
Elapsed: 00:00:00.20
yd@MYDB.MU> commit;
Commit complete.
Elapsed: 00:00:01.50
yd@MYDB.MU> select data,
data_enc,
decrypt(data_enc) data
from t;
2 3 4
DATA DATA_ENC DATA
__________ ________________________________ __________
012345678 07CF8213EDC46C277C720164D915B70C 012345678
Elapsed: 00:00:00.07
yd@MYDB.MU>
hope this helps too!
kind regards
yogeeraj
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-14-2006 02:29 PM
05-14-2006 02:29 PM
Re: Script using encrypt and decrypt.
Thanks for your solutions. But I want a shell script or a C program or executable.
Because the target site does not use Oracle, their RDBMS is sybase.
I am sorry for not being clear earlier.
This is what we have. We have a table in Oracle with encrypted passwords. Now I have to extract the passwords, decrypt them into an ascii file. Then I need a C executable or a shell script to read this ascii file encrypt the password, and write back to the same file, then I will have to send the file and the executable / shell script to the target site and they will de-crypt and load into their database.
Thanks
IA
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-14-2006 09:16 PM
05-14-2006 09:16 PM
Re: Script using encrypt and decrypt.
once you have the passwords extracted into the ascii file,what is the problem with the standard tools:
crypt,password protected zip and Public key ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-15-2006 12:03 AM
05-15-2006 12:03 AM
Solutionyou may also look into HP-UX Secure Shell. The client-server architecture supports the SSH-1 and SSH-2 protocols and provides secured remote login, file transfer, and remote command execution.
http://h20293.www2.hp.com/cgi-bin/swdepot_parser.cgi/cgi/displayProductInfo.pl?productNumber=T1471AA
also have a look at Chris Vail's document "Using H/P's Secure Shell & Secure Copy" (attached)
kind regards
yogeeraj
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-15-2006 12:40 PM
05-15-2006 12:40 PM
Re: Script using encrypt and decrypt.
When I extract the passwords into the ascii file, first I will decrypt the password from our encryption procedure, then before writing into the ascii file, I want to encrypt using a key and then write into the ascii file.
the I will gzip the file and use the UNXI crypt to encrypt the complete file.
At the target site, they will decrypt rthe file using the key we prove, then gunzip the file and when they read the contents of the file, they will use the same code as we did to encrypt the individual passwords, they will decrypt and then store into their database using their encryption rules.
This sound all too many encryptions and decryptions, but the two orginations that are in the process of mergining do not want to give their encryption/decryption procedures to either. Instead decrypt from the source, then use a common code that is applicable to source and target sites, encrypt at source end and they will decrypt at the target end and then apply their own encryption rules.
Indira A