1

I am using Oraclize in a smart contract and want to encrypt my API key. According to http://docs.oraclize.it/#ethereum-advanced-topics-encrypted-queries there is a python script from Oraclize that is used to encrypt text (https://github.com/oraclize/encrypted-queries), and this command should encrypt "YOUR QUERY" for example:

python encrypted_queries_tools.py -e -p 044992e9473b7d90ca54d2886c7addd14a61109af202f1c95e218b0c99eb060c7134c4ae46345d0383ac996185762f04997d6fd6c393c86e4325c469741e64eca9 "YOUR QUERY"

Running that command I get this error:

C:\Python27\encrypted-queries-master\encrypted-queries-master\tools>python encrypted_queries_tools.py -e -p 044992e9473b7d90ca54d2886c7addd14a61109af202f1c95e218b0c99eb060c7134c4ae46345d0383ac996185762f04997d6fd6c393c86e4325c469741e64eca9 "YOUR QUERY" File "encrypted_queries_tools.py", line 100 print "Please, provide a valid public key" Is the public key given on the website incorrect?

0

The script you are trying to run is in fact for Python 2. You are trying to use Python 3 there, (as you stated on your github issue) and also based on the fact that the error message is due to the Python 2 formatted print statement. If you wish to use Python 3, you can use the following utility to convert the code seamlessly to be compatible with Python 3 - https://docs.python.org/2/library/2to3.html

If you have Python 2 available, you should be able to use that as well, just ensure all the modules it uses, are installed and available locally for you, you can use pip for this.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.