Link to home
Start Free TrialLog in
Avatar of jbusad97
jbusad97

asked on

Give a real usage example of using crypt

Can someone give an actual example of using the Solaris crypt utility on a file?
ASKER CERTIFIED SOLUTION
Avatar of tfewster
tfewster
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of dtkerns
dtkerns

also note, if you're a vi user you can use the following to edit the encrypted file:

vi -x encrypted.file

it prompts for the key just before clearing the screen and showing the contents
and of course, if the key you entered is wrong, you see junk ;)
Avatar of jbusad97

ASKER

For instance, if I have a file called foo.:

user1>$ ls -la
total 6
drwxr-xr-x   2 user1 staff      512 Aug 25 11:35 .
drwxr-xr-x  11 user1 staff      512 Aug 25 11:35 ..
-rw-r--r--   1 user1 staff      141 Aug 25 11:35 foo

show the steps that would be taken to encrypt this file.  Or better yet, create the file on your system, perform the steps for encryption, then cut and past your steps as your answer.  This is what was meant as a "real example".

Thanks.
crypt mykey   < foo  > foo.encrypted; mv foo.encrypted foo
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

Answered by tfewster {11885539}

Please leave any comments here within the next four days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

liddler
EE Cleanup Volunteer
CRYPT AN ASCII FILE

An ascii file can be easily encrypted and
decrypted.

To encrypt simply pipe the STDOUT of
the file to "crypt" and redirect it to
a new file name. Enter a passowrd when
prompted with "Enter key".

$ cat foo | crypt > foo.e
Enter key:

To unencrypt simply pipe the STDOUT of
the encrypted file to "crpyt" and
redirect it to a new file name. Enter
a passowrd when prompted with
"Enter key".

$ cat foo.e | crypt > foo.new
Enter key:

or use vi -x to view the file
$ vi -x foo.e
Enter key: