Ruby native extension for triple DES cryptography.
rake --tasks
ruby ext/tdes/extconf.rb
rake clobber clean compile
rake test
Or
RUBY_VERSION=3.0 $SHELL -c 'docker build --build-arg RUBY_VERSION=${RUBY_VERSION} -t ruby-app:${RUBY_VERSION} . && docker run -it --rm ruby-app:${RUBY_VERSION}'
rake build
rake install
sudo gem install tdes
- Change the code
- Change the VERSION file
- Run:
bundle install
- Push the code
- Open the PR
- Merge into master
- Pull master
- Run:
rake release
Having OpenSSL and Ruby installed, it should work out of the box.
You may need to explicitly set your OpenSSL installation directory
rbenv:
export CFLAGS='-std=c99 -I ~/.rbenv/versions/3.0.2/openssl/include/'
export LDFLAGS='-lcrypto -L ~/.rbenv/versions/3.0.2/openssl/lib/'
rake clean compile
homebrew with asdf:
export CFLAGS="-std=c99 -I /opt/homebrew/opt/openssl@3.0/include/"
export LDFLAGS="-lcrypto -L /opt/homebrew/opt/openssl@3.0/lib/"
export CPPFLAGS="-I /opt/homebrew/opt/openssl@3.0/include"
lol
require 'rubygems'
require 'tdes'
key = '1111111111111111'
cipher = TDES::TDES.new(key)
encrypted = cipher.encrypt('12345678') # "\x85\x8B\x17m\xA8\xB1%\x03"
decrypted = cipher.decrypt(encrypted) # "12345678"
MIT Licence. Copyright (c) 2022-2022 Cloudwalk.