cryptPw = crypt(plainPw, "$1$abcdefgh$")
I can do it in python, with package i need?
Thanks
>>> import ctypes
>>> lib = ctypes.CDLL("libcrypt.so.1")
>>> crypt = lib.crypt
>>> crypt.restype = ctypes.c_char_p
>>> crypt("password", "$1$abcdefgh$")
'$1$abcdefgh$G//4keteveJp0qb8z2DxG/'
Is that what it's supposed to return?
Peter
> Seems like my posts are dropping off of the net all of a sudden.
> In case this didn't go through the first time...
>
> http://docs.python.org/py3k/library/crypt.html#module-crypt
>
> Geremy Condra
This particular post did get get through, it is even marked as read over
here.
Sorry for any confusion my pointless answer may have caused.
Peter
seeing this I thought about using ctypes for AES (or similar) crypto
function. A bit of google searching I've come to
http://code.google.com/p/ctypescrypto/
just FYI
--
дамјан ((( http://damjan.softver.org.mk/ )))
... knowledge is exactly like power - something
to be distributed as widely as humanly possible,
for the betterment of all. -- jd
ctypescrypto does not appear to be maintained, but I've started
a similar project called evpy (http://gitorious.org/evpy) that also
provides envelope encryption. Comments are welcome- we're
probably going to be doing our first release sometime towards
the middle of next month.
Geremy Condra
Luca
> On 20 Apr, 19:38, Peter Otten <__pete...@web.de> wrote:
>> luca72 wrote:
>> > Hello i have to do this :
>> > glibc crypt() function, using salt $1$abcdefgh$
>>
>> > cryptPw = crypt(plainPw, "$1$abcdefgh$")
> Thanks
> The result is correct i obtain the same with ctypes and crypt module,
> so i think that is better to use the crypt module is correct?
Yes, use the crypt module.
Be aware that the beginning of the salt string determines the
type of hash you're using, and it looks to me like that's the
old-style MD5-based hash. It's far from 'broken', but it has a
few issues. Better would be to move to the SHA512-based
$6$ if your platform supports it.
Geremy Condra