Code Monkey home page Code Monkey logo

krypt's Introduction

krypt

========= Build Status

krypt. semper pi.

The goal of krypt is to provide a platform- and library-independent cryptography API for the Ruby language (http://www.ruby-lang.org). It can be used with all C(++)-based Ruby implementations as well as JRuby.

The major part of krypt is implemented in Ruby, and it additionally offers the possibility to integrate OS- or language-specific native libraries to implement cryptographic primitives. krypt aims at offering performance while still improving the security and features of the Ruby cryptography infrastructure. Its motto is to keep all the good parts of what exists today and to improve the parts that need improvement. It offers an idiomatic, modern API that cherry-picks the best features of other popular libraries and also offers new features that are not offered by others today.

krypt-core-c

The C implementation of the krypt-core API to be used with all C-based Rubies. The repository can be found at

https://github.com/krypt/krypt-core-c.

krypt-core-java

Realizes the krypt-core API in Java to be used by Jruby (http://www.jruby.org). The repository can be found at

https://github.com/krypt/krypt-core-java.

krypt-core-ruby

An all Ruby implementation of krypt-core. Access to the native krypt-provider libraries is realized via FFI. The repository can be found at

https://github.com/krypt/krypt-core-ruby.

krypt-provider-openssl

A realization of the krypt-provider API in C that utilizes OpenSSL (http://www.openssl.org). Can also be used by JRuby via krypt-core-ruby and FFI. The repository is at

https://github.com/krypt/krypt-provider-openssl.

krypt-provider-jdk

Realization of the krypt-provider API in Java exclusively to be used by JRuby. The implementation is based on the JDK built-in security and cryptography library. The repository is at

https://github.com/krypt/krypt-provider-jdk.

License

Copyright (c) 2012-2013 Hiroshi Nakamura and Martin Boßlet. krypt and all its sub projects are distributed under the MIT License. See LICENSE for further details.

krypt's People

Contributors

andrasio avatar emboss avatar headius avatar vipulnsward avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

krypt's Issues

Problems loading krypt-core on OS X Mountain Lion

On Ruby 2.0.0:

╭─tony@vertex  ~ ‹ruby-2.0.0›
╰─$ gem install krypt
Fetching: binyo-0.0.1.gem (100%)
Building native extensions.  This could take a while...
Successfully installed binyo-0.0.1
Fetching: krypt-provider-openssl-0.0.1.gem (100%)
Building native extensions.  This could take a while...
Successfully installed krypt-provider-openssl-0.0.1
Fetching: krypt-core-0.0.1.gem (100%)
Building native extensions.  This could take a while...
Successfully installed krypt-core-0.0.1
Fetching: krypt-0.0.1.gem (100%)
Successfully installed krypt-0.0.1
Parsing documentation for binyo-0.0.1
unable to convert "\xCF" from ASCII-8BIT to UTF-8 for lib/binyo.bundle, skipping
unable to convert "\xF0" from ASCII-8BIT to UTF-8 for lib/binyo.so, skipping
Installing ri documentation for binyo-0.0.1
Parsing documentation for krypt-provider-openssl-0.0.1
unable to convert "\xCF" from ASCII-8BIT to UTF-8 for lib/kryptprovideropenssl.bundle, skipping
unable to convert "\xE8" from ASCII-8BIT to UTF-8 for lib/kryptprovideropenssl.so, skipping
Installing ri documentation for krypt-provider-openssl-0.0.1
Parsing documentation for krypt-core-0.0.1
unable to convert "\xCF" from ASCII-8BIT to UTF-8 for lib/kryptcore.bundle, skipping
unable to convert "\x80" from ASCII-8BIT to UTF-8 for lib/kryptcore.so, skipping
Installing ri documentation for krypt-core-0.0.1
Parsing documentation for krypt-0.0.1
Installing ri documentation for krypt-0.0.1
4 gems installed
╭─tony@vertex  ~ ‹ruby-2.0.0›
╰─$ irb -rkrypt
/Users/tony/.rvm/rubies/ruby-2.0.0-p0/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require':LoadError: dlsym(0x7f7fc3b8b650, Init_kryptcore): symbol not found - /Users/tony/.rvm/gems/ruby-2.0.0-p0/gems/krypt-core-0.0.1/lib/kryptcore.bundle
2.0.0p0 :001 >

On Ruby 1.9.3:

╭─tony@vertex  ~ ‹ruby-1.9.3›
╰─$ gem install krypt
Fetching: binyo-0.0.1.gem (100%)
Building native extensions.  This could take a while...
Fetching: krypt-provider-openssl-0.0.1.gem (100%)
Building native extensions.  This could take a while...
Fetching: krypt-core-0.0.1.gem (100%)
Building native extensions.  This could take a while...
Fetching: krypt-0.0.1.gem (100%)
Successfully installed binyo-0.0.1
Successfully installed krypt-provider-openssl-0.0.1
Successfully installed krypt-core-0.0.1
Successfully installed krypt-0.0.1
4 gems installed
Installing ri documentation for binyo-0.0.1...
Installing ri documentation for krypt-provider-openssl-0.0.1...
Installing ri documentation for krypt-core-0.0.1...
Installing ri documentation for krypt-0.0.1...
Installing RDoc documentation for binyo-0.0.1...
Installing RDoc documentation for krypt-provider-openssl-0.0.1...
Installing RDoc documentation for krypt-core-0.0.1...
Installing RDoc documentation for krypt-0.0.1...
╭─tony@vertex  ~ ‹ruby-1.9.3›
╰─$ irb -rkrypt
/Users/tony/.rvm/rubies/ruby-1.9.3-p392/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require':LoadError: dlsym(0x7fd3f964c480, Init_kryptcore): symbol not found - /Users/tony/.rvm/gems/ruby-1.9.3-p392/gems/krypt-core-0.0.1/lib/kryptcore.bundle
1.9.3p392 :001 >

Add PKCS8 key format support

In order to create and publish DKIM keys, PKCS8 format is required. This is supported by OpenSSL but none of the Ruby layers so far have supported it natively.

Is this scheduled on the roadmap somewhere? If not, would adapting the PKCS5 implementation, which is nearly identical, be a useful contribution?

RSA crypto

Is there any support for RSA cryptography yet ? If not, Is there any plan to implement it ?
Thank you

Documentation

Hi, Where can I find documentation on Krypt? - hopefully with some examples!

Regards,

Carl

Issues with krypt when running a rails application on a java application server

I have a lot of issues like below when I run the application:

[#|2013-09-03T19:42:30.128+0200|INFO|glassfish3.1.2|javax.enterprise.system.container.web.com.sun.enterprise.web|_ThreadID=19;_ThreadName=Thread-3;|PWC1412: WebModule[null] ServletContext.log():
Krypt::Provider::ServiceNotAvailableError (The requested service is not available):
gems/gems/krypt-0.0.1/lib/krypt/provider.rb:32:in new_service' gems/gems/krypt-0.0.1/lib/krypt/digest.rb:100:innew'
org/jruby/RubyBasicObject.java:1735:in instance_eval' gems/gems/krypt-0.0.1/lib/krypt/digest.rb:101:innew'
gems/gems/krypt-0.0.1/lib/krypt/digest.rb:106:in new' gems/gems/krypt-ossl-0.1.0/lib/krypt/ossl/pkcs5.rb:10:inpbkdf2_hmac_sha1'
gems/gems/activesupport-4.0.0.rc1/lib/active_support/key_generator.rb:21:in generate_key' gems/gems/activesupport-4.0.0.rc1/lib/active_support/key_generator.rb:38:ingenerate_key'
gems/gems/actionpack-4.0.0.rc1/lib/action_dispatch/middleware/cookies.rb:436:in initialize' gems/gems/actionpack-4.0.0.rc1/lib/action_dispatch/middleware/cookies.rb:159:inencrypted'
gems/gems/actionpack-4.0.0.rc1/lib/action_dispatch/middleware/cookies.rb:168:in `signed_or_encrypted'

The same action works half of the time.

Thanks

Krypt::Provider::ServiceNotAvailableError in Rails

Devise provide a lib from Rails to generate tokens, see here, and testing in rails console this works fine:

irb(main):002:0> OpenSSL::PKCS5.pbkdf2_hmac_sha1("s3cr37_70k3n", "s3cr37", 2**16, 64)
=> "\xB4N2FY\xE8`\xA2l(E\xCC\xB8]~@\x157-\xDCG\xBB\x7F;55F\xF09N\x9A(R\xDB[Z\xF3c\xB52\xBD\x7F\xD8\x93[\x16\x7F\xD2\xB3\x80~\x8E1\x8F\x00\x0Ej8\\,q\xF4\x87\xBE"

But, running rails server this not work as expected:

Krypt::Provider::ServiceNotAvailableError in Namespace::SomeController#create

Searching on issues, I found some issues similar and tried all possible fixes without success.

My env:

  • JRuby 1.7.9
  • Oracle Java 1.7u45
  • Rails 3.2.16
  • Devise 3.2.2
  • OSX 10.9.1 with OpenSSL 1.0.1f

Observation: in other issues people try gems krypt and jruby-openssl in Gemfile but this not work for me.

JRuby fails when running on platform without ffi support

this is related to #47 in the sense if native support for FFI is missing for a particular platform then JRuby fails and this failing happens on require 'openssl' - see jruby/jruby#1800

would be nice if krypt could gracefully fallback on NOT using the native FFI provider in such cases.

looking at the message of the LoadError and see if it contains Could not load FFI Provider: (NotImplementedError) FFI not available is a hack so any idea on improving things on JRuby side are welcome !

unsupported platforms for FFI and not detecting the right platform is recurrent issue on JRuby.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.