If you have a problem or need to report a bug please email : support@dsprobotics.com
There are 3 sections to this support area:
DOWNLOADS: access to product manuals, support files and drivers
HELP & INFORMATION: tutorials and example files for learning or finding pre-made modules for your projects
USER FORUMS: meet with other users and exchange ideas, you can also get help and assistance here
NEW REGISTRATIONS - please contact us if you wish to register on the forum
Users are reminded of the forum rules they sign up to which prohibits any activity that violates any laws including posting material covered by copyright
sha example link
4 posts
• Page 1 of 1
sha example link
I saw on the forum an example on how to use the ruby SHA for encryption and decryption.I try to find again but not found. Can someone provide a link?
- Logado
- Posts: 62
- Joined: Tue Jan 06, 2015 5:42 pm
Re: sha example link
Never saw an example, but it is not too difficult. At first you need to grab the OpenSSL library from Ruby, since it is not part of Flowstone's Ruby. If you install it as described in the FS manual, you can afterwards access it using
you can then access SHA (or MD) like so
Read more about it here: http://ruby-doc.org/stdlib-1.9.3/libdoc/openssl/rdoc/OpenSSL/Digest.html
- Code: Select all
require 'openssl'
you can then access SHA (or MD) like so
- Code: Select all
data = File.read('document')
sha256 = OpenSSL::Digest::SHA256.new
digest = sha256.digest(data)
Read more about it here: http://ruby-doc.org/stdlib-1.9.3/libdoc/openssl/rdoc/OpenSSL/Digest.html
"There lies the dog buried" (German saying translated literally)
- tulamide
- Posts: 2714
- Joined: Sat Jun 21, 2014 2:48 pm
- Location: Germany
Re: sha example link
yeah in theory it's simple but my ruby show me only error, i try now compile ruby.
I hope this helps
found example, but here only generate hash,i need digital signature .
I understand that in any case it was hacked, but I want to understand how to use asynchronous key generation.
I hope this helps
found example, but here only generate hash,i need digital signature .
I understand that in any case it was hacked, but I want to understand how to use asynchronous key generation.
- Attachments
-
- Pure_Ruby_SHA1_%26_MD5_implementation_DWB-2013.fsm
- (2.64 KiB) Downloaded 710 times
- Logado
- Posts: 62
- Joined: Tue Jan 06, 2015 5:42 pm
Re: sha example link
Logado wrote:...but I want to understand how to use asynchronous key generation.
You really need Ruby's OpenSSL implementation. It's all in there. See http://ruby-doc.org/stdlib-1.9.3/libdoc/openssl/rdoc/OpenSSL.html
Regarding installation: You not only need to install Ruby's OpenSSL (not OpenSSL), you also need to install each dependency that is not already part of Ruby's standard installation. You do so by looking at any .rb of Ruby's OpenSSL and searching for each 'require'.
It is cumbersome, but not difficult. Maybe you should install a full Ruby 1.9.3 (that the version Flowstone uses). It will contain everything you need, and you could copypaste from there.
"There lies the dog buried" (German saying translated literally)
- tulamide
- Posts: 2714
- Joined: Sat Jun 21, 2014 2:48 pm
- Location: Germany
4 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 71 guests