DES encryption is somehow broken
--------------------------------

                 Key: JRUBY-1194
                 URL: http://jira.codehaus.org/browse/JRUBY-1194
             Project: JRuby
          Issue Type: Bug
          Components: OpenSSL
    Affects Versions: JRuby 1.0.0
         Environment: OSX java 1.5
            Reporter: Kurt Werle
            Assignee: Thomas E Enebo
         Attachments: DES_Encoding_Test.tar.gz

DES encryption should be compatible with ruby and java, but it is not.  Please 
see the included tarball for an easy test.

In short, the following will yield different results if run under jruby than it 
does under ruby:

{code}
        IV  = "IVIVIVIV"
        Key = "KEYKEYKE"
        
        Alg = "des"
        
        
        def encrypt(clear_string)
                cipher = OpenSSL::Cipher::Cipher.new(Alg)
                cipher.encrypt(Key, IV)
                cipher.padding = 32
                cipher.key = Key
                cipher.iv = IV
                
                encrypted = cipher.update(clear_string)
                encrypted << cipher.final
    
                return encrypted
        end
{code}



-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe from this list please visit:

    http://xircles.codehaus.org/manage_email

Reply via email to