Now I am using sha1 encription for my module in magento, but I want to change the encription to base64. i use this password for a connection in API
<password translate="label comment"> <label>Api Password</label> <frontend_type>password</frontend_type> <backend_model>adminhtml/system_config_backend_encrypted</backend_model> <sort_order>30</sort_order> <show_in_default>0</show_in_default> <show_in_website>0</show_in_website> <show_in_store>1</show_in_store> <comment><![CDATA[Api password provided by eMAG.]]></comment> <validate>required-entry</validate> </password>
let me know what I need to changed to use this ecription only for this autentification and not for the entire magento.
I am familiar with how Git creates SHA1 hashes for files (blobs), but not how they are created for tag objects. I assume they are, if I create an annotated tag, but what is the recipe? And how might I replicate it outside of Git (e.g., in Perl or Python)?
The SHA1 hashes stored in the tree objects (as returned by
git ls-tree) do not match the SHA1 hashes of the file content (as returned by
$ git cat-file blob 4716ca912495c805b94a88ef6dc3fb4aff46bf3c | sha1sumde20247992af0f949ae8df4fa9a37e4a03d7063e -
How does git compute file hashes? Does it compress the content before computing the hash?
I need the ruby equivalent of the following:
openssl x509 -sha1 -fingerprint -noout -in cert.pem
The code that I wrote is:
data = File.read("cert.pem")data["-----BEGIN CERTIFICATE-----\n"]=""data["-----END CERTIFICATE-----\n"]=""OpenSSL::Digest::SHA1.new(Base64.encode64(data))
This code does not generate the same fingerprint as the openssl cli command does.
Any idea what I may be doing wrong?
I want python to read to the EOF so I can get an appropriate hash, whether it is sha1 or md5. Please help. Here is what I have so far:
import hashlibinputFile = raw_input("Enter the name of the file:")openedFile = open(inputFile)readFile = openedFile.read()md5Hash = hashlib.md5(readFile)md5Hashed = md5Hash.hexdigest()sha1Hash = hashlib.sha1(readFile)sha1Hashed = sha1Hash.hexdigest()print "File Name: %s" % inputFileprint "MD5: %r" % md5Hashedprint "SHA1: %r" % sha1Hashed