Hi to all! I?m writing a python module (python+sqlalchemy) to manage user and domain configuration on my system (I hope to get a CLI tool, a Web app and even a native Mac app, via PyObjc, from my lib). I?m implementing password crypto, but I have some problem in generating CRAM-MD5 password, dovecot style. I?ve found an old discussion on this mailing list and a piece of Perl that works, but I need to implement it in Python; I?ve even read code (hmac-md5.c), but before start hard coding (hard from my POV at least, since I?ve never worked with crypto algorithms in a deep way), is there anyone that have had solved the problem or has any idea on how to approach it? TIA Andre
On 12/16/2009 05:11 PM Andre wrote:> Hi to all! > ? > I?m implementing password crypto, but I have some problem in generating CRAM-MD5 password, dovecot style. > ? is there anyone that have had solved the problem or has any idea on how to approach it?CRAM-MD5 requires a lot of code. ;) It was to hard to me for the moment, so I'm using subprocess.Popen. If this may be a solution for you, have a look at: http://hg.localdomain.org/vmm/file/160/VirtualMailManager/VirtualMailManager.py#l416 Regards, Pascal -- The trapper recommends today: decade.0935018 at localdomain.org
On 16/dic/2009, at 20.01, Nick Douma wrote:> On 16-12-2009 17:11, Andre wrote: >> Hi to all! >> I?m writing a python module (python+sqlalchemy) to manage user and domain configuration on my system (I hope to get a CLI tool, a Web app and even a native Mac app, via PyObjc, from my lib). >> I?m implementing password crypto, but I have some problem in generating CRAM-MD5 password, dovecot style. >> I?ve found an old discussion on this mailing list and a piece of Perl that works, but I need to implement it in Python; I?ve even read code (hmac-md5.c), but before start hard coding (hard from my POV at least, since I?ve never worked with crypto algorithms in a deep way), is there anyone that have had solved the problem or has any idea on how to approach it? >> >> TIA >> Andre > > If the module is always going to run on a machine with dovecot > installed, you could call from your script: > > $ dovecotpw -s CRAM-MD5 -p <password> >I know, I thought to do in this way, but it introduces an unnecessary and strong dependency. Imagine of a web server running the administration interface, that is not even the IMAP server (I know I can install only common dovecot components) or imagine to write a OSX/Windows Administration tool (I would like to write a Xcode/PyOBjc tool). Anyway, I?ll give a try to module hmac. Andre
Reasonably Related Threads
- cram-md5 and users maintaining their own passwords?
- CRAM-MD5 authentication but plain-md5 password storage.
- Using pgsql with 'cram-md5 auth' and 'hmac-md5 scheme'
- CRAM-MD5 Password Generation Algorithm
- dovecot.conf: mechanisms = plain login cram-md5 | Windows Live Mail: CRAM-MD5 authentication failed. This could (NOT) be due to a lack of memory on your system