Permalink
Browse files

ruby 1.9 fixes - rotation fun

  • Loading branch information...
1 parent 0bdd13d commit 929f5ece9ba6ed6237689ded2e1432cae5dc8469 Eric Monti committed Oct 30, 2009
Showing with 12 additions and 10 deletions.
  1. +1 −0 .bnsignore
  2. +4 −0 History.txt
  3. +1 −1 lib/rbkb.rb
  4. +4 −7 lib/rbkb/extends.rb
  5. +2 −2 rbkb.gemspec
View
@@ -22,3 +22,4 @@ pkg
bin/experimental
reference
*.gem
+.DS_Store
View
@@ -1,3 +1,7 @@
+== 0.6.12 / 2009-10-15
+ * better ruby 1.8 <-> 1.9 portability
+ * tweaked rotate_bytes while dorking around with rotation lameness
+
== 0.6.11 / 2009-10-06
* split off rbkb/http as its own package
* added some new String crypto utilities in extends
View
@@ -2,7 +2,7 @@
module Rbkb
# :stopdoc:
- VERSION = '0.6.11'
+ VERSION = '0.6.12'
LIBPATH = ::File.expand_path(::File.dirname(__FILE__)) + ::File::SEPARATOR
PATH = ::File.dirname(LIBPATH) + ::File::SEPARATOR
# :startdoc:
View
@@ -269,13 +269,10 @@ def ^(x)
# Byte rotation as found in lame ciphers.
# This was cribbed from Timur Duehr with only a minor change.
def rotate_bytes(k=0)
- r = self.dup
- i=0
- self.each_byte do |b|
- r[i] = ((b + k) % 384).chr
- i+=1
- end
- return r
+ k = (256 + k) if k < 0
+ self.bytes.map do |c|
+ ((c + k) & 0xff)
+ end.join()
end
View
@@ -2,11 +2,11 @@
Gem::Specification.new do |s|
s.name = %q{rbkb}
- s.version = "0.6.11"
+ s.version = "0.6.12"
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
s.authors = ["Eric Monti"]
- s.date = %q{2009-10-07}
+ s.date = %q{2009-10-16}
s.description = %q{Rbkb is a collection of ruby-based pen-testing and reversing tools. Inspired by Matasano Blackbag.}
s.email = %q{emonti@matasano.com}
s.executables = ["b64", "bgrep", "blit", "c", "crc32", "d64", "dedump", "feed", "hexify", "len", "plugsrv", "rex", "rstrings", "slice", "telson", "unhexify", "urldec", "urlenc", "xor"]

0 comments on commit 929f5ec

Please sign in to comment.