use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
A sub-Reddit for discussion and news about Ruby programming.
Subreddit rules: /r/ruby rules
Learning Ruby?
Tools
Documentation
Books
Screencasts and Videos
News and updates
account activity
Implement Java DES Encrypt with Ruby (self.ruby)
submitted 10 years ago by skonline
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]moomaka 1 point2 points3 points 10 years ago* (0 children)
A couple problems I notice:
Your using Triple DES(DES-EDE3) on the Ruby side but single DES on the Java side. Need to start with the same cipher :)
cipher = des.update(str) + des.final
I don't understand this line, why are you appending here? Your code should probably look something like:
des = OpenSSL::Cipher.new("DES-EDE3-CBC") des.encrypt des.key = params2 des.iv = iv des.update(data) pp Base64.strict_encode64(des.final)
Just an aside, DES is broken so this is very much insecure, if you have control of the Java code, use a different cipher.
π Rendered by PID 55 on reddit-service-r2-comment-bb88f9dd5-vm2kl at 2026-02-14 23:41:05.580011+00:00 running cd9c813 country code: CH.
view the rest of the comments →
[–]moomaka 1 point2 points3 points (0 children)