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? Thanks, David
On 20 Nov 2005, at 18:54, D Washburn wrote:
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:
This is a FAQ. Python scripts provide a *restricted* execution environment. You cannot just import any old Python module. See the README inside the PythonScripts folder under <zope>/lib/python/ Products for more information. jens
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
--On 20. November 2005 12:54:58 -0500 D Washburn <tech@aminfo.com> wrote:
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.
FAQ: read lib/python/Products/PythonScripts/README.txt -aj
participants (4)
-
Andreas Jung -
D Washburn -
Jens Vagelpohl -
Tino Wildenhain