Mail Archives: djgpp/1999/09/23/20:39:44
If ms-dos was unix, you would probably want to do something like
encrypted_password = crypt(plaintext_password, seed);
But the problem is that crypt() is not included in djgpp, and I believe the
reason for this is that there are some silly legal issues involved which
basically makes it illegal to export the crypt() code outside the US.
However, you can easily find the algorithm by searching the net or even get the
source code from the standard GNU distribution of C libraries. Look for a file
called glibc-something.tar.gz and that's it. Notice that by downloading the
code to a site outside the US you're doing an illegal act, so if you're outside
the US you might want to find a glibc which is located outside the US. If you
have Linux you'll be able to find it on your own machine (provided you have the
Linux source).
Last of all, it's not difficult to hack your own version of crypt() but then
keep in mind it might not work like the proper crypt().
Wong Chun Fung Gary wrote:
> On Wed, 22 Sep 1999, Eli Zaretskii wrote:
> >
> > On 22 Sep 1999, Wong Chun Fung Gary wrote:
> >
> > > How can I get crypt work in DJGPP?
> > > I've got to implement a password checking function.
> >
> > It would help if you explain what are your problems in implementing
> > ``a password checking function''. If you mean you need to read a
> > password from the user without echoing, you can use the library function
> > `getpass' or `getlongpass'.
>
> In fact, I would like to use the crypt function on most UN*X system.
> This is the one I want to have:
>
> $ man crypt
>
> CRYPT(3) Library functions CRYPT(3)
>
> NAME
> crypt - password and data encryption
>
> SYNOPSIS
> #define _XOPEN_SOURCE
> #include <unistd.h>
>
> char *crypt(const char *key, const char *salt);
>
> DESCRIPTION
> crypt is the password encryption function. It is based on
> the Data Encryption Standard algorithm with variations
> intended (among other things) to discourage use of hard-
> ware implementations of a key search.
>
> key is a user's typed password.
>
> salt is a two-character string chosen from the set
> [a-zA-Z0-9./]. This string is used to perturb the algo-
> rithm in one of 4096 different ways.
--
Fred Backman
Lead Wizard
Binary Spells
www.binaryspells.com
- Raw text -