TDES
Ruby native extension for triple DES cryptography.
Install dependencies
bundle installList all available rake tasks
rake --tasksGenerate Makefile
ruby ext/tdes/extconf.rbCompile
rake clobber clean compileRun tests
rake testOr
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}'Build local version
rake buildBuild and Install local version
rake installInstall version from Rubygems
sudo gem install tdesPush to Rubygems
- Change the code
- Change the VERSION file
- Run:
bundle install- Push the code
- Open the PR
- Merge into master
- Pull master
- Run:
rake releaseLinux
Having OpenSSL and Ruby installed, it should work out of the box.
MacOS
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 compilehomebrew 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"Windows
lol
Examples
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"Copyright
MIT Licence. Copyright (c) 2022-2022 Cloudwalk.