GSoC Mid-Term Report

This post tries to provide a brief update about the last months explorations around krypt.

Some of the things I tried touching over the month:

RIPEMD160

Fix Digest with above

Lay Cipher Prototype Implementation

Provide Cipher JCE Implementation

Provide Streaming Base64 Implementation and of course READ A LOT.

=====

I l try laying out first what and how, I had to read and understand, and lay the prototype implementations.

It all started by reading the Bouncy Castle Implementations to get to know better about the whole implementation for Crypto and Digest. I then moved on to understand how actually krypt-core-java and krypt-jce-provider worked, where my actual work was going to be.

My coding began by providing RIPEMD160 implementation to the jce-provider. Again this was hugely based on the BC Impl. Next I made a hook in the jce for the RIPEMD call.

The next thing was laying the Cipher JCE interface based on terms with the Digest. This still need work, with proper and full definitions. {More on this later}

In the meanwhile Martin, integrated Base64 and Hex Streaming implementations. So I move on to read what they did, and how they interfaced with the Ruby world. At this point of time, I really started to looking into how Java was  being exposed to the Ruby world.

There were some crazy times over here, where I wasn’t able to figure out key issues of exposure, like Method argument handling, block handling, arrays, byte handling among a long list. This made me actually look deeply into plugin development for JRuby. I plan to do some documentation work on this, with lots of help from the JRuby community soon.

It was awesome to get an example implementation of how Martin wanted, by his Hex impl. So I later ported Base64 based on the same, for streaming impl. This was one of the “tasks”, that was on the platter to complete.

Next I move on to Ciphers on krypt-core. It was a huge help from jruby-ossl, that gave a perfect interface for the OpenSSL::Cipher ruby module. I ported the same, to provide prototype implementation with full cross-compatibility, with the Ruby version. But again this was a self contained version, meaning it used its own way on instantiation Ciphers, and that was a blocker, since we wanted them to be provided over by JCE. {We wanted to remove the BC Provider Dependencies that jruby-ossl currently relies on}

So that’s one of the TODO’s , to move on to use the exported functionality from krypt-jce, for Cipher interface.

I was to write specs for Cipher, which I was onto, when my machine crashed. And now have started to work on them, after a full revamp of my Machine.

Summary

In all most of my work was surrounded on reading and understanding and then doing small bits to be supported by Krypt. It was an awesome month, and if the evaluations go through, the next month would be even awesomer!

Ahead

If all goes fine, Martin will be laying out the IO impl that we want to base the Signature’s for safely working on password storage in memory{or the avoidance of the same}. Once he does that, I l try using the underlying architecture JRuby already provides, to emulate what Martin will implement.

Then on it will be implementing  Signatures themselves. The implementation of the same would then decide our journey ahead.

Mysql2 gem Error

Today while working with mysql2 gem, I ran into

“SL connection error: error:00000001:lib(0):func(0):reason(1)”

which was specific to only my machine, apart from the other devs.

I have Mac OS X, with rbenv managing my rubies. I was using brew as the package manager.

I was trying to access remote database over mysql2 connect. I went on to read the internals of mysql2, which gave no answers, and then onto the openssl gem form ruby sources, with vain.

Finally, what gave way was unistalling and unlinking openssl package from brew. After which reinstalling my ruby, gave way for accessing without certificate errors.

I l need to search more, for what was messing up with the whole setup, but somehow my ruby was using wrong paths for .pem files, from brew installation.