Alessio Caiazza

Articles tagged 'yubikey'

YubiRuby - Yubikey with Ruby

Some days ago, willing to learn how to extends ruby with C code, I wrote a wrapper for yubico-c library.

You can find the sourcecode of my work on bitbucket and some installation instruction on the gemmcutter page.

After installing the gem with gem install YubiRuby you can try it with the following code

require 'rubygems'
require 'YubiRuby'

key = "6df89690b5f51bd9ac912c5004781e86" #use your AES key
y = YubiRuby::Yubikey.new(key);
puts y.key
otp = gets().strip
puts y.parse(otp)
puts "Ouput: #{y}"
puts "uid: #{y.uid}"
puts "counter: #{y.counter}"
puts "capslock: #{y.triggered_by_capslock?}"
puts "timestamp low/high: #{y.timestamp_low}/#{y.timestamp_high}"
puts "session: #{y.session}"
puts "random: #{y.random}"
puts "crc: #{y.crc}"
puts "crc residue: #{y.crc_residue}"
puts "crc residue ok?: #{y.crc?} (#{y.crc_residue} == #{YubiRuby::Yubikey::CRC_OK_RESIDUE})"

I hope to find the time for writing an authlogic extension in order to use a yubikey with rails application.

(l0g.in 44EHHH)
Alessio

Hello. My name is Alessio Caiazza. I'm also known as nolith. I love writing code and technology. I'm passionate about production engineering.

This is where I write my thoughts trying to follow IndieWeb principles.

Staff Backend Engineer, Delivery @ GitLab

he/him/his

IU5BON HamRadio callsign

"Il sapere umano appartiene al mondo."

← An IndieWeb Webring πŸ•ΈπŸ’ β†’