File: arcfour_check.rb

package info (click to toggle)
ruby-net-ssh 1%3A2.9.1-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 1,484 kB
  • ctags: 1,862
  • sloc: ruby: 12,621; makefile: 2
file content (20 lines) | stat: -rw-r--r-- 555 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20

require 'net/ssh'

# ARCFOUR CHECK 
# 
# Usage:
#     $ ruby support/arcfour_check.rb
#
# Expected Output:
#     arcfour128: [16, 8] OpenSSL::Cipher::Cipher
#     arcfour256: [32, 8] OpenSSL::Cipher::Cipher
#     arcfour512: [64, 8] OpenSSL::Cipher::Cipher

[['arcfour128', 16], ['arcfour256', 32], ['arcfour512', 64]].each do |cipher|
  print "#{cipher[0]}: "
  a = Net::SSH::Transport::CipherFactory.get_lengths(cipher[0])
  b = Net::SSH::Transport::CipherFactory.get(cipher[0], :key => ([].fill('x', 0, cipher[1]).join))
  puts "#{a} #{b.class}"
end