[an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive]
 
[an error occurred while processing this directive] [an error occurred while processing this directive]
Skåne Sjælland Linux User Group - http://www.sslug.dk Home   Subscribe   Mail Archive   Forum   Calendar   Search
MhonArc Date: [Date Prev] [Date Index] [Date Next]   Thread: [Date Prev] [Thread Index] [Date Next]   MhonArc
 

Re: [CPROG] Crypt()



On Mon, 2 Aug 1999, Flemming Danielsen wrote:

> Jeg er ved at lave et admin udtil til oprettelse af brugere, samt
> password. Mit problem er at generere et MD5 password vha. crypt() og
> hvad skal den salt string i kaldet til crypt bruges til ??

crypt benytter DES (eller en DES-lignende algorithme) til een-vejs
kryptering, og ikke MD5 -- på de fleste UNIX platforme, jeg mener at
FreeBSD bruger MD5?

For at generere et krypteret password med crypt, tager du brugens
cleartext password og two tilfældige tegn (se man crypt på hvad de må
være, det skal fx. være kun bogstaver, tal og ikke vilkårlige ASCII tegn)  
-- som bliver "salt", en slags "seed" til generationen af det krypterede
password.

Så kalder du crypt() og får det krypterede password. De første to tegn af
det krypterede password er det salt der blev brugt.

Næste gang password skal checkes, tager man det password som påstås at
være det rigtige password, og krypterer det på samme måde. Hvis den
krypterede streng er identisk med den krypterede streng vi har gemt, er
passwordet rigtigt.


-- 
==============================================================================
Erwin Andreasen   Herlev, Denmark <sslug@sslug>          UNIX System Programmer
<URL:http://www.andreasen.org>              <*>         (not speaking for) DDE
==============================================================================



 
Home   Subscribe   Mail Archive   Index   Calendar   Search

 
 
Questions about the web-pages to <www_admin>. Last modified 2005-08-10, 20:07 CEST [an error occurred while processing this directive]
This page is maintained by [an error occurred while processing this directive]MHonArc [an error occurred while processing this directive] # [an error occurred while processing this directive] *