[Zope] MD5 Python Zope Plone
Tino Wildenhain
tino at wildenhain.de
Sun Nov 20 13:05:43 EST 2005
Am Sonntag, den 20.11.2005, 12:54 -0500 schrieb D Washburn:
> I have a need to encrypt a parameter passed on a URL to another
> website using Python and MD5 encryption. I tried to set up a test
> python script:
>
> I am running ZOPE and Plone. I have made other Python scripts that
> work.
> *******************
> import md5
>
> print "This is the", script.meta_type, '"%s"' % script.getId(),
> if script.title:
> print "(%s)" % html_quote(script.title),
> print "in", container.absolute_url()
>
> hash1 = md5.new("Hello world").digest()
> print "hash=",hash1
>
> return printed
> **************
> When I do this and I attempt to test it - my ZOPE/Plone instance pops
> up the login screen (even though I am logged in already). I tried
> logging in but it just kept asking for my username/password.
>
> Suggestions? Anyone got a simple example of a Python script that can
> be passed a piece of text and return an encrypted string?
You would need either an external method where you use md5
or a simple product (basically just an __init__.py derived
from Products/PythonScripts/module_access_examples.py )
Btw, md5() does not encrypt. Its a hash. (You cannot
get the original text from it)
HTH
Tino
More information about the Zope
mailing list