How can i encrypt a text file using a key?


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers How can i encrypt a text file using a key?
# 1  
Old 02-09-2010
How can i encrypt a text file using a key?

Hi

My aim is to encrypt a text file using a key.
I found a command 'crypt' in Unix. But it says -bash: crypt: command not found. Could any one tell me the package to install to get this work?

Any other alternatives for encryption? I would like to do it from shell script. I'm using NetBSD 3.1.

Please help

Thanks & Regards
Renju
# 2  
Old 02-09-2010
What is crypt:
crypt - The GNU C Library

But some OS do have a command crypt (such as HP-UX...)
# 3  
Old 02-09-2010
Hi,

Thanks for the reply.. I wanted it to try from command line..

Unix Commands

This URL says there is a unix command 'crypt'. ()..

How can i install its package? Because for me it says
crypt: command not found

regards
Renju
# 4  
Old 02-09-2010
As I have said, there may not be a crypt command on your OS (AIX doesnt seem tp have, but HP-UX has and SOLARIS also...) but the system uses it and so it should be there in your libraries, did you try
Code:
whereis crypt

The explanation:
crypt (Unix) - Wikipedia, the free encyclopedia

---------- Post updated at 15:24 ---------- Previous update was at 14:49 ----------

Solutions:
Dr. Dobb's | Encryption Using Crypt::CBC | February 1, 2004


You could use openssl:
Code:
openssl enc -des3 -in inputfile -out outfile

# 5  
Old 02-21-2010
Apropos of nothing much whatsoever at all etc etc

I'm amazed at what I just found out. Cygwin has crypt. And here I'd been using openssl to do what few encryptions I've so far needed to do this year.

Kind of a cryptic (npi) --version number return, though. It looks like this:
Code:
 >> crypt --version
0SBIQ3IC.EAtU

I was curious to know if it was part of coreutils or a later add-on. About 36 hours ago, I went ahead and installed -- via setup.exe -- the rest of the development packages (though apparently not enough of it since qmake still doesn't work). If it came from that set, then it ought to be available for NetBSD in some form or another.

BZT
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Encrypt and Decrypt a File with Password

Hello, I have few files on unix which are payroll related and I need them to encrypt with password so others wouldn't see the data. I use ETL tool and would like to know the unix command that does encryption/decryption to use in the ETL. Thank you, Sri (3 Replies)
Discussion started by: eskay
3 Replies

2. Shell Programming and Scripting

Need help with file encrypt

Hi I need to encrypt the below file using the translate command to shift each letter five characters to the end of the character set. ALPHABETICAL FACTS. THE FIRST THREE LETTERS ARE ABC. THE MEDIAN LETTERS ARE MN. THE LAST THREE LETTERS ARE XYZ. THE FIRST WORD IN MY DISCTIONARY IS AAL. THE... (1 Reply)
Discussion started by: drew211
1 Replies

3. HP-UX

how to encrypt a file with ebcdic conversion

Hi guys! My sql*plus program generating dat file. so this dat file i want to write in destination sever path with ebcdic formate through SFTP only, because my destination server is mainframe it can read only ebcdic formate files only. could you please help on this........ i was written... (3 Replies)
Discussion started by: sgangadhar19
3 Replies

4. Linux

SSL/TLS uses the public key to encrypt data ?

Hi, I have a doubt..whether the SSL/TLS protocol uses the public key of the web server to encrypt data before sending it. I knew the browser verifies the public key of the web server using the digital certificate (by verifying the signature of the certificate using trusted authority). whether... (2 Replies)
Discussion started by: chaitus.28
2 Replies

5. Shell Programming and Scripting

Encrypt TEXT File

Hi, I need to encrypt the text file, Can anyone help me giving the code snippet. Thanks in Advance.. Waiting for your reply Regards BS (3 Replies)
Discussion started by: balajiora
3 Replies

6. Solaris

encrypt file

dear all i have xml file on solaris contains password for the databse how can i encrypt the password but the apache can read the password after encrypt it or if any one have any idea to make no one can read the password except apache (1 Reply)
Discussion started by: murad.jaber
1 Replies

7. Shell Programming and Scripting

How to encrypt and decrypt a file

How to encrypt and decrypt a file using unix Command? Can any one help me? (2 Replies)
Discussion started by: laknar
2 Replies

8. Shell Programming and Scripting

how to replace a text inside a file based on a xml key

<c-param> <param-name>Number</param-name> <param-value>22</param-value> <description>my house number</description> </c-param> <c-param> <param-name>Address</param-name> ... (4 Replies)
Discussion started by: reldb
4 Replies

9. Solaris

Decrypt Des file - then encrypt

Help.. I need to decrypt a file that was encrypted using DES 56 Bit. I have the encryption key and the block size used but no idea what utility to use.. I then need to encrypt the file using pgp and another key I have.. againt I dont know what utility to use. I am running solaris 9 .... ... (0 Replies)
Discussion started by: frustrated1
0 Replies

10. Shell Programming and Scripting

How to encrypt a script file

Dear all, I want to encrypt my script file so that other persons cannot change or view the script.How to do this ? Thanks, Nayanajith. (2 Replies)
Discussion started by: Nayanajith
2 Replies
Login or Register to Ask a Question