From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <96075318306344.tru64-unix-managers.marc@archive.invalid> From: Andrew Pochinsky Date: Wed, 01 Mar 1995 16:44:21 +0000 To: tru64-unix-managers Subject: SUMMARY: C2 password encryption X-MARC-Message: https://marc.info/?l=tru64-unix-managers&m=96075318306344 My original question was: > I'm looking for a procedure converting the plaintext password to the > auth-entry password string under C2. The DEC OSF/1 Enhanced Security > manual seems to be quite obscure on this issue. What it says is that > the password is encrypted using the crypt(3) routine in 8-characters > blocks. What is does not say is which salt is used in encyphering all > blocks but the first one. I tried using the same salt and the last two > characters from the previous block -- neither works. > I've got 4 replies all recommending undocumented bigcrypt(). It has the same interface as crypt(3) but some wrapping was needed to make it really work. The following procedure does the trick: #include #include char *C2_crypt(char *txt, char *salt) { extern char *bigcrypt(char *, char *); SIAENTITY *entity; static char *argv[] = {"crypt", 0}; char *pwd; sia_ses_init(&entity, 1, argv, NULL, "crypt", NULL, FALSE, NULL); pwd = bigcrypt(txt, salt); entity = NULL; sia_ses_release(&entity); return pwd; } And, of course, the security library is needed. Thanks to: Richard Rogers Clyde Hoover Randy M. Hayman Barry Lynam -- Andrew Pochinsky