How can I crypt and decrypt a password in C

How can I crypt and decrypt a password in C

Post by Rainer Temm » Sat, 06 Jun 1998 04:00:00




> I am devoloping an application that has to use crypted password for some
users
> and I wonder If there is some library that crypt and decrypt password.

see man-pages for crypt(3C).
You'll not find a function to decrypt passwords, because crypt() is
intended
to work one way only. The usual check if a password is valid or not is to
crypt the password again, and check if you get the same (crypted) result.
If so, the password was valid, if not, the password was invalid.

Regards Rainer

 
 
 

How can I crypt and decrypt a password in C

Post by Vasco Alexandre Da Silva Cos » Sat, 06 Jun 1998 04:00:00


: Hello

: I am devoloping an application that has to use crypted password for some users
: and I wonder If there is some library that crypt and decrypt password.

Sure, there is the crypt() function, try "man -s 3c crypt".  Depending on
the Unix system, this can either be in lc or in lcrypt.

A few Unixes don't have this function because of export restrictions.

--

Technical University of Lisbon - Software & Computer Engineering

 
 
 

How can I crypt and decrypt a password in C

Post by Jon LaBad » Sun, 07 Jun 1998 04:00:00



|> : Hello
|>
|> : I am devoloping an application that has to use crypted password for some users
|> : and I wonder If there is some library that crypt and decrypt password.
|>
|> Sure, there is the crypt() function, try "man -s 3c crypt".  Depending on
|> the Unix system, this can either be in lc or in lcrypt.
|>
|> A few Unixes don't have this function because of export restrictions.

Anyone know why makekey(1), a cmd level interface to the crypt(3C)
function, usually in /usr/lib/makekey, is not available on Solaris
(neither 2.5 nor 2.6) even for export unrestricted systems?

jl
--


 4455 Province Line Road        (609) 252-0159
 Princeton, NJ  08540-4322      (609) 683-7220 (fax)

 
 
 

How can I crypt and decrypt a password in C

Post by Adrian Havil » Sun, 09 Aug 1998 04:00:00



> I am devoloping an application that has to use crypted password for some users
> and I wonder If there is some library that crypt and decrypt password.

In Unix? Look at the following man page below on your system.

BTW, the password you type in Unix for loggining in is never decrypted. The
password you type is really the "key" to encrypt a block of zero bytes. When
checking for a password, the encrypted block of zeros (ASCIIfied) is
compared to the encrypted password in the password file for a match.

=====

crypt(3C)              C Library Functions              crypt(3C)
NAME
     crypt, setkey, encrypt - generate encryption
SYNOPSIS
     #include <crypt.h>
     char *crypt(const char *key, const char *salt);
     void setkey(const char *key);
     void encrypt(char *block, int edflag);

--
Adrian Havill <URL:http://www.threeweb.ad.jp/>
Engineering Division, Systems Section

 
 
 

1. decrypting a crypt()-password

Hi,

could anyone be so kind, please, and post a little example code showing
how to decrypt a password that has been crypted with crypt() before?

TIA,
Patrick

--
---------------------------------------------------------------------------

                  URL: http://www.geocities.com/Vienna/5357/

     Fingerprint: 3C FB B0 A7 E2 C2 3B 2D  68 6C 66 7E B7 D5 C2 70
---------------------------------------------------------------------------

2. Ultra66 and Mandrake

3. crypt/decrypt/encrypt .. where are these system utils??

4. Cook 2.7 - file construction tool

5. crypt/decrypt problems on Solaris 2.3?

6. Errors with libmysqlclient while compiling apache

7. Decrypting UNIX crypt(1) encrypted files

8. ET-6000

9. crypt/decrypt

10. Reusable passwords (was: Re: password hasher (crypt()) replacement)

11. decrypt password

12. NIS+ Password does not decrypt error

13. Password does not decrypt secret key?