Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #21484

Re: How to re-implement the crypt.crypt function?

From Cosmia Luna <cosmius@gmail.com>
Newsgroups comp.lang.python
Subject Re: How to re-implement the crypt.crypt function?
Date 2012-03-11 03:10 -0700
Organization http://groups.google.com
Message-ID <17753159.3543.1331460619089.JavaMail.geo-discussion-forums@ynnk21> (permalink)
References <28304124.1374.1331408016748.JavaMail.geo-discussion-forums@yncd8> <mailman.550.1331410629.3037.python-list@python.org>

Show all headers | View raw


On Sunday, March 11, 2012 4:16:52 AM UTC+8, Christian Heimes wrote:
> Am 10.03.2012 20:33, schrieb Cosmia Luna:
> > I'm not searching for a full solution and only want to know how to use hashlib to create a equivalent string like 
> 
> If you chance your mind and choose to use a full solution, then I highly
> recommend passlib [1]. It has an implementation of SHA-512 crypt as
> indicated by the number 6 in the header of your string.
> 
> By the way "$6$ds41p/9VMA.BHH0U" is *not* the salt. Just
> "ds41p/9VMA.BHH0U" is the salt, 6 is a hash identifier.
> 
> Christian
> 
> [1] http://packages.python.org/passlib/

PassLib works for me. What I want is passlib.context, I need it in consideration of forward compatibility.

Thanks a lot.

But I still want to know how it is implemented, I read passlib's source but I found he/she re-implemented hashlib, which I can't understand. Now I knows that the encoding is hash64 instead of base64, but I can't know that. PassLib is too difficult for me. Anyone knows the accurate process?

Cosmia

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

How to re-implement the crypt.crypt function? Cosmia Luna <cosmius@gmail.com> - 2012-03-10 11:33 -0800
  Re: How to re-implement the crypt.crypt function? Roy Smith <roy@panix.com> - 2012-03-10 15:15 -0500
    Re: How to re-implement the crypt.crypt function? Christian Heimes <lists@cheimes.de> - 2012-03-10 21:36 +0100
      Re: How to re-implement the crypt.crypt function? Roy Smith <roy@panix.com> - 2012-03-10 15:41 -0500
        Re: How to re-implement the crypt.crypt function? Christian Heimes <lists@cheimes.de> - 2012-03-10 22:07 +0100
  Re: How to re-implement the crypt.crypt function? Christian Heimes <lists@cheimes.de> - 2012-03-10 21:16 +0100
    Re: How to re-implement the crypt.crypt function? Cosmia Luna <cosmius@gmail.com> - 2012-03-11 03:10 -0700
    Re: How to re-implement the crypt.crypt function? Cosmia Luna <cosmius@gmail.com> - 2012-03-11 03:10 -0700

csiph-web