Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

crypt(3) [v7 man page]

CRYPT(3)						     Library Functions Manual							  CRYPT(3)

NAME
crypt, setkey, encrypt - DES encryption SYNOPSIS
char *crypt(key, salt) char *key, *salt; setkey(key) char *key; encrypt(block, edflag) char *block; DESCRIPTION
Crypt is the password encryption routine. It is based on the NBS Data Encryption Standard, with variations intended (among other things) to frustrate use of hardware implementations of the DES for key search. The first argument to crypt is a user's typed password. The second is a 2-character string chosen from the set [a-zA-Z0-9./]. The salt string is used to perturb the DES algorithm in one of 4096 different ways, after which the password is used as the key to encrypt repeat- edly a constant string. The returned value points to the encrypted password, in the same alphabet as the salt. The first two characters are the salt itself. The other entries provide (rather primitive) access to the actual DES algorithm. The argument of setkey is a character array of length 64 containing only the characters with numerical value 0 and 1. If this string is divided into groups of 8, the low-order bit in each group is ignored, leading to a 56-bit key which is set into the machine. The argument to the encrypt entry is likewise a character array of length 64 containing 0's and 1's. The argument array is modified in place to a similar array representing the bits of the argument after having been subjected to the DES algorithm using the key set by setkey. If edflag is 0, the argument is encrypted; if non-zero, it is decrypted. SEE ALSO
passwd(1), passwd(5), login(1), getpass(3) BUGS
The return value points to static data whose content is overwritten by each call. CRYPT(3)

Check Out this Related Man Page

CRYPT(3)						     Library Functions Manual							  CRYPT(3)

NAME
crypt, setkey, encrypt - DES encryption SYNOPSIS
char *crypt(key, salt) char *key, *salt; setkey(key) char *key; encrypt(block, edflag) char *block; DESCRIPTION
Crypt is the password encryption routine. It is based on the NBS Data Encryption Standard, with variations intended (among other things) to frustrate use of hardware implementations of the DES for key search. The first argument to crypt is normally a user's typed password. The second is a 2-character string chosen from the set [a-zA-Z0-9./]. The salt string is used to perturb the DES algorithm in one of 4096 different ways, after which the password is used as the key to encrypt repeatedly a constant string. The returned value points to the encrypted password, in the same alphabet as the salt. The first two char- acters are the salt itself. The other entries provide (rather primitive) access to the actual DES algorithm. The argument of setkey is a character array of length 64 containing only the characters with numerical value 0 and 1. If this string is divided into groups of 8, the low-order bit in each group is ignored, leading to a 56-bit key which is set into the machine. The argument to the encrypt entry is likewise a character array of length 64 containing 0's and 1's. The argument array is modified in place to a similar array representing the bits of the argument after having been subjected to the DES algorithm using the key set by setkey. The edflag flag is ignored; the argument can only be encrypted. SEE ALSO
passwd(1), passwd(5), login(1), getpass(3) BUGS
The return value points to static data whose content is overwritten by each call. 7th Edition August 12, 1986 CRYPT(3)
Man Page

15 More Discussions You Might Find Interesting

1. Programming

DES Encryption

Hello I'm writing a program to "lock" my computer while in X-mode (sort of my own version of xlock). I've written the basic stuff.. but now I need encrypt the entered password, and compare it to the encrypted password in the /etc/shadow-file.. I looked in the man-pages for 'des', but I'm a... (4 Replies)
Discussion started by: Maestin
4 Replies

2. UNIX for Dummies Questions & Answers

File Encryption and Decryption in UNIX.

Hello guys ! I have used "crypt <first> second" command to encrypt "first" to "second" file. i have assign a key for that of course. Now when i try to look content of "seocnd" file through "cat second" command, the file is encrypted and cannot be read which is according to plan. But when... (3 Replies)
Discussion started by: abidmalik
3 Replies

3. Shell Programming and Scripting

encrypt my sctipt

Hai , is there any encrypt machanishm to protect my script or logic? (4 Replies)
Discussion started by: readycpbala
4 Replies

4. Solaris

Password Encryption (SunOS 5.8)

Hi all, I have a server in the office that we connect to via telnet. Can anyone explain please how i can encrypt the password so it cannot be picked up in plain text by sniffing software like WireShark, etc.? I'm not very experienced in Unix, so any ideas or even links would be great. ... (5 Replies)
Discussion started by: de049
5 Replies

5. Shell Programming and Scripting

Blank space cause error when use perl

I write a script with register and login user. So, i encrypt password with encryptedpass=`perl -e "print crypt("${mypass}",salt)"` if password do not contain blank space, it work but if password have blank space, it cause error in that line the error is: syntax error at -e ..... Anyone... (3 Replies)
Discussion started by: WuZun
3 Replies

6. UNIX for Dummies Questions & Answers

Password encryption

In unix, i know the password encrypt by using salt But how does it work? And how windows protect its password? Thank you for helping in advance (5 Replies)
Discussion started by: cryogen
5 Replies

7. Red Hat

Cannot open SELinux encrypted disks

When I installed Fedora 10 I set the option to encrypt my file systems but now I can't open either of my two HDD's. I asks me for my password and gives me three options concerning the "remembering" of my password but when I put the password in nothing happens at all. Any ideas? Thanks. (3 Replies)
Discussion started by: jasonfrost
3 Replies

8. UNIX for Dummies Questions & Answers

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... (4 Replies)
Discussion started by: renjumc
4 Replies

9. Linux

Secured encrypted files via Linux

I need to encrypt a ".txt" file with password settings and it should decrypt the file automatoically when end user types correct password. Can some one help me on this. Thank you (3 Replies)
Discussion started by: rlmadhav
3 Replies

10. Linux

Question about Encryption...

hey guys, how're you all doing?? guys i wanna ask a question about something we can call it encryption!! i want to encrypt a file by converting it to (hex or octal) then convert another file witch will be the code to hex or octal also, then add them together and convert the result again to... (2 Replies)
Discussion started by: iam_ako
2 Replies

11. Shell Programming and Scripting

Problems using shc

Hi all! First of all, sorry for my poor english :-S Well, I have some scripts in a SuSe server to encrypt... but all them must still working when I encrypt it, ok? About the server, I have root access: # id uid=0(root) gid=0(root) groups=0(root) # uname -a Linux servername... (4 Replies)
Discussion started by: Magius
4 Replies

12. AIX

Encryption in AIX

Can I encrypt PDF files in AIX 5.3? (2 Replies)
Discussion started by: anthony123
2 Replies

13. Cybersecurity

Linux Encryption methods

Hi all, I am looking to encrypt a filesystem with a CentOS 6.4 install. However I note that when using LUKS the system does not boot without prompting for the password encryption key. I am looking for an drive/filesystem encryption solution which will allow reboots and shutdown/starts of the... (4 Replies)
Discussion started by: landossa
4 Replies

14. Shell Programming and Scripting

Data Encryption

Using awk or sed command how can i encrypt the characters for a particular column.For every character it should replace the third charter of alphabets.Example replace "A" with "C" and "B" with "D"..like this it should replace for all characters in particular column. Using below command i am able... (3 Replies)
Discussion started by: katakamvivek
3 Replies

15. AIX

Verifying a users password on AIX setup with LPA

Hello, We're running AIX 6 & 7. Previously we were using the old encryption techinique (DES/crypt) I have a GUI application that has a verify button (the verify button is sort of a digital signature) - the user clicks it, enters his or her password and we then make a call to a C module, This... (3 Replies)
Discussion started by: evansch
3 Replies