yubiruby /

Filename Size Date modified Message
bin
ext
lib
tasks
test
268 B
94 B
296 B
1.5 KB
1.0 KB
2.1 KB
= YubyRuby

Yubico Server wrapper in Ruby


== Installation

 $ gem install YubiRuby

== Some examples

Checking an OTP

 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 "session counter: #{y.session_counter}"
 puts "capslock: #{y.triggered_by_capslock?}"
 puts "timestamp low/high: #{y.timestamp_low}/#{y.timestamp_high}"
 puts "session use: #{y.session_use}"
 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})"

Generating a valid yubikey

 key = YubiRuby::FakeYubikey.new
 key.set_random_key
 key.set_random_uid
 key.public_id = "vvefeeccebek"
 puts "Yubikey generated"
 puts "public id:\t#{key.public_id}"
 puts "key:\t\t#{key.key}"
 puts "uid:\t\t#{key.uid}"
 puts "And now 3 otp"
 3.times { puts key.otp }
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.