We have a commerce in Magento version 1.8.1 and using Redsys module to implement payment trough VISA.With the new implementation of SHA256 for SSL, Redsys provides the following module to upgrade/install Redsys module (actually version 2.8.3):
Installation went alright: placed things where it should be and started debugging.
So, here we go: All runs, it appears to work perfectly on first try BUT orders are still in "New" state and not in "Processing". Also TPV platform, in Notifications, tells a "180" which means it returns to my commerce but something goes wrong.
Obviously something is going bad in the return it the code is the genuine code of the module.
Any idea on this?
I have following algoritm in Ruby that gives result "cdcd9305b2b1d461fdd2e96f59b71347a654cc4c060bebe44b07629b247d9466".
#encoding: utf-8require 'digest/sha2'hash = "324116d8dccd4ed34fa434e2a1538d54"code = "abcefg"file = "file.jpg"signFile_bin = File.binread(file).force_encoding("utf-8")digest = Digest::SHA256.newstr = hash << code << signFile_bindigest.update(str)puts digest
Now I am trying to implement this algorithm in Java, but stuck at concatenation of hash, code and file:
String hash = "324116d8dccd4ed34fa434e2a1538d54";String code = "abcefg";File file = new File("file.jpg");MessageDigest md = MessageDigest.getInstance("SHA-256");FileInputStream fileInputStream = new FileInputStream(file);byte bytes = new byte[(int) file.length()];fileInputStream.read(bytes);fileInputStream.close();
How do I check if my SSL Certificate is using SHA1 or SHA2, from the commandline?
And yes, i this is similar to this, but i need a cli-tool and i want to understand how it is done.
I want to use sha256 in my project, but I had some troubles rewriting objC code to swift code. Help me please. I used this answer: How can I compute a SHA-2 (ideally SHA 256 or SHA 512) hash in iOS?
Here's my code
var hash : [CUnsignedChar]CC_SHA256(data.bytes, data.length, hash)var res : NSData = NSData.dataWithBytes(hash, length: CC_SHA256_DIGEST_LENGTH)
it gives me error everything because swift cannot convert
CC_LONG, for example.
I'm using Tomcat 8.0.17 with JDK 1.8.0_25. I'm using Derby for the database.
I have a DataSourceRealm working with FORM authentication using SHA-256 digests.
My $WEBAPP/META-INF/context.xml looks like this:
<Context> <ResourceLink global="jdbc/demo" name="jdbc/demo" type="javax.sql.DataSource" /> <Realm className="org.apache.catalina.realm.DataSourceRealm" digest="SHA-256" dataSourceName="jdbc/demo" userTable="users" userNameCol="user_name" userCredCol="user_pass" userRoleTable="user_roles" roleNameCol="role_name"/></Context>
When using the digest tool that comes with Tomcat, I can manually update the users.user_pass column in the database with the output of the digest tool and everything works (note -s 0 since Tomcat does not work with salted hashes):
C:\>"%CATALINA_HOME%\bin\digest" -a SHA-256 -s 0 hotdoghotdog:$1$35602208e86ac7d6b3a63780a9538a9d1763a646d5b9f3930a0548e0983e0ca6...ij> update users set user_pass='$1$35602208e86ac7d6b3a63780a9538a9d1763a646d5b9f3930a0548e0983e0ca6' where user_name='demouser';1 row inserted/updated/deleted
Now I am able to log in successfully.
Now how do I programmatically (in Java) generate SHA-256 hashed passwords to insert into the database? I've seen many examples of generating SHA-256 hashes and converting the byte string to hex. But the part that is throwing me off is the beginning of the hash when using the digest tool. It always generates hashes with '$' in the beginning. When converting a hash programmatically and encoding in hex, there will never be '$' characters included in the output (since there is no '$' in hex, only 0-F). But Tomcat seems to work fine with the digest tool output (which includes the dollar signs).