1837777 Members
3522 Online
110119 Solutions
New Discussion

File ecncryption in UNIX

 
mojtaba
Occasional Advisor

File ecncryption in UNIX

which tools is proper for encryprtion and decryption file in unix?
i wnat to use DES or RSA signature methods.
please help me
Best Regards.
15 REPLIES 15
Matt Hearn
Regular Advisor

Re: File ecncryption in UNIX

"crypt" is the standard tool that comes with most flavors of UNIX; you simply provide a key and it'll encrypt anything you want:

cat filename | crypt > filename.crypt

It'll prompt for a key. I don't believe there's a "decrypt" command in HP-UX; if you want to read the file you can use 'vi -x filename.crypt' and it'll prompt for the key again. I'm not sure if there's any way to implement DES or RSA with crypt, though; perhaps someone else knows of another software tool you could install.
Mike Shilladay
Esteemed Contributor

Re: File ecncryption in UNIX

Hi,

You could use the EVFS, see link to check compatibilty with you requirements.

http://h20338.www2.hp.com/hpux11i/cache/324629-0-0-225-121.html?jumpid=reg_R1002_USEN

Mike.
Dave La Mar
Honored Contributor

Re: File ecncryption in UNIX

There are a few options. We are using OpenSSL, Sterling Software Direct Connect, PGP, and Valicert, depending upon the associated vendor need.
For your question, not knowing why you need to encrypt, I would suggest OpenSSL. It will provide RC4 or AES encryption and is readily available for multiple platforms even as freeware.

Best of luck on this.

Regards,

-dl
"I'm not dumb. I just have a command of thoroughly useless information."
Steven E. Protter
Exalted Contributor

Re: File ecncryption in UNIX

Shalom,

Might want to consider PGP.

http://software.hp.com
Search for Internet Express

Pick your OS and download ixPGP software. It is quite useful and compatible with commercial encryption software.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Steven Schweda
Honored Contributor

Re: File ecncryption in UNIX

> http://software.hp.com
> Search for Internet Express
>
> Pick your OS and download ixPGP software.

Have you tried this lately? For "HP-UX
Internet Express for HP-UX 11i v1", I see a
GnuPG (which might be suitable), but no
*PGP*.


> which tools is proper for encryprtion and
> decryption file in unix?

The answer to this question may depend on a
few unknowns, like why you want to encrypt
something, what you want to encrypt, how
secure the encryption needs to be, and so on.
T G Manikandan
Honored Contributor

Re: File ecncryption in UNIX

mojtaba
Occasional Advisor

Re: File ecncryption in UNIX

Dear All
thanks for you helps.
i need to automatically encrypt the file at the end of day.

Best regards.
Shrikant Lavhate
Esteemed Contributor

Re: File ecncryption in UNIX

Hi,

make a script with these commands:

#crypt key crypt_file
#rm file

where,
key is password for file to undecrypt
file is file to encode
crypt_file is file in encoded form

And make a entry in crontab so that it will execute at each dayend.crontab entry will be:

59 23 * * * Script_path

Good luck.
Will it remain a personal, if I broadcast it here!
mojtaba
Occasional Advisor

Re: File ecncryption in UNIX

Dear Shrikant
I want to use DES or RSA for encryption. because after encryption it we should send it to another to decrypt it.

Thanks
Best Regards.
Matti_Kurkela
Honored Contributor

Re: File ecncryption in UNIX

OpenSSL contains both DES and RSA, and even more encryption methods. The name "OpenSSL" is misleading: it's an all-purpose encryption library, not just for SSL.

For example, to encrypt using a symmetric encryption algorithm like DES:

openssl enc -e -des -in plaintext.txt -out encrypted.dat -pass file:/well/protected/cryptokey.txt

And to decrypt:
openssl enc -d -des -in encrypted.dat -out decrypted.txt -pass file:/well/protected/cryptokey.txt

Note that the simple DES is too weak for today's technology. Even triple-DES (des3) is barely adequate for low-level protection.

Each sub-command of OpenSSL has a separate man page: to get more information about "openssl enc", use "man enc" after installing OpenSSL.

To use an asymmetric encryption algorithm like RSA, you must first generate a pair of keys. A proper RSA key pair has an interesting feature: when data is encrypted using one half of the key pair, it cannot be decrypted using that same key... you must use the _other_ half of the key pair to decrypt the data. Usually, one half of the key pair is called "private key" and the other "public key".

In addition, encrypting large amounts of data using plain RSA is not very efficient: usually, some symmetric encryption algorithm is used to encrypt the data with a random key ("session key") which is used only once. Then the key is protected using RSA and the encrypted key is sent along with the data. The recipient then uses RSA to decrypt the session key, then uses the session key to decrypt the data.

"RSA signature" may not be an encryption method at all: it's more like a way to prove that the data is from you and it has not been tampered with. If you need this, OpenSSL has tools for this too.

MK
MK
eric roseme
Respected Contributor

Re: File ecncryption in UNIX

If you want to "automatically encrypt the file at the end of the day" then why not just use EVFS and store it on the device encrypted? Then it is encrypted all of the time. The caveat is that it is still accessible by users who have permissions to access it - in other words, EVFS does not affect accessibility, it only encrypts the data at rest on the storage device.
Dave La Mar
Honored Contributor

Re: File ecncryption in UNIX

Actually, you can script the ecryption using about any of the methods described in this thread.
In our shop, there is no manual encryption, all file encryptions are scripted.

-dl
"I'm not dumb. I just have a command of thoroughly useless information."
Steven Schweda
Honored Contributor

Re: File ecncryption in UNIX

> If you want to "automatically encrypt the
> file at the end of the day" then why not
> just use EVFS and store it on the device
> encrypted?

Perhaps:

> [...] because after encryption it we
> should send it to another to decrypt it.

Sometimes it pays to look at the actual
requirements provided (eventually).

In this situation, I'd probably use GnuPG, as
cited (repeatedly) above. It's a public-key
system (RSA). Other solutions also exist, of
course. Another consideration is the
software in use or available at the far end,
where the decryption is to be done. (We can
_assume_ that it's also HP-UX, but we
shouldn't _need_ to assume anything.)
mojtaba
Occasional Advisor

Re: File ecncryption in UNIX

Dear All
Thank you for helps.
Now i install GnuPG in HP-UX. How we can use it for encryption?
Please send me a document including command for GnuPG?

Thanks
Best Regards.
Shrikant Lavhate
Esteemed Contributor

Re: File ecncryption in UNIX

Hi,

Here is the documentation for this tool.

http://www.gnupg.org/(en)/documentation/index.html

Shri.
Will it remain a personal, if I broadcast it here!