xvp 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/.gitignore +4 -0
- data/Gemfile +4 -0
- data/Rakefile +2 -0
- data/lib/xvp.rb +7 -0
- data/lib/xvp/encryption.rb +24 -0
- data/lib/xvp/version.rb +4 -0
- data/xvp.gemspec +21 -0
- metadata +74 -0
data/.gitignore
ADDED
data/Gemfile
ADDED
data/Rakefile
ADDED
data/lib/xvp.rb
ADDED
@@ -0,0 +1,24 @@
|
|
1
|
+
# -*- coding: UTF-8 -*-
|
2
|
+
module Xvp
|
3
|
+
module Encryption
|
4
|
+
|
5
|
+
def self.encrypt_vnc(password)
|
6
|
+
key = [0xc1, 0x24, 0x08, 0x99, 0xc2, 0x26, 0x07, 0x05]
|
7
|
+
des = OpenSSL::Cipher::Cipher.new("des-ecb")
|
8
|
+
des.key = key.map {|b| b.chr}.join
|
9
|
+
|
10
|
+
des.update(password).unpack('H*').first
|
11
|
+
end
|
12
|
+
|
13
|
+
def self.encrypt_pool(password)
|
14
|
+
(16 - password.length).times { password << "\0"}
|
15
|
+
key = [0xcc, 0x10, 0x10, 0x58, 0xbe, 0x03, 0x07, 0x66]
|
16
|
+
des = OpenSSL::Cipher::Cipher.new("des-cbc")
|
17
|
+
des.key = key.map {|b| b.chr}.join
|
18
|
+
des.encrypt
|
19
|
+
# Order matters!
|
20
|
+
encrypt_last_part = des.update(password[8..15])
|
21
|
+
encrypt_first_part = des.update(password[0..7])
|
22
|
+
(encrypt_first_part + encrypt_last_part).unpack('H*').first
|
23
|
+
end
|
24
|
+
end
|
data/lib/xvp/version.rb
ADDED
data/xvp.gemspec
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
$:.push File.expand_path("../lib", __FILE__)
|
3
|
+
require "xvp/version"
|
4
|
+
|
5
|
+
Gem::Specification.new do |s|
|
6
|
+
s.name = "xvp"
|
7
|
+
s.version = Xvp::VERSION
|
8
|
+
s.platform = Gem::Platform::RUBY
|
9
|
+
s.authors = ["Thiago Morello"]
|
10
|
+
s.email = ["morellon@gmail.com"]
|
11
|
+
s.homepage = "https://github.com/morellon/xvp"
|
12
|
+
s.summary = %q{XVP password encryption for ruby}
|
13
|
+
s.description = %q{XVP password encryption for ruby}
|
14
|
+
|
15
|
+
s.rubyforge_project = "xvp"
|
16
|
+
|
17
|
+
s.files = `git ls-files`.split("\n")
|
18
|
+
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
19
|
+
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
20
|
+
s.require_paths = ["lib"]
|
21
|
+
end
|
metadata
ADDED
@@ -0,0 +1,74 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: xvp
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
hash: 27
|
5
|
+
prerelease: false
|
6
|
+
segments:
|
7
|
+
- 0
|
8
|
+
- 1
|
9
|
+
- 0
|
10
|
+
version: 0.1.0
|
11
|
+
platform: ruby
|
12
|
+
authors:
|
13
|
+
- Thiago Morello
|
14
|
+
autorequire:
|
15
|
+
bindir: bin
|
16
|
+
cert_chain: []
|
17
|
+
|
18
|
+
date: 2011-06-02 00:00:00 -03:00
|
19
|
+
default_executable:
|
20
|
+
dependencies: []
|
21
|
+
|
22
|
+
description: XVP password encryption for ruby
|
23
|
+
email:
|
24
|
+
- morellon@gmail.com
|
25
|
+
executables: []
|
26
|
+
|
27
|
+
extensions: []
|
28
|
+
|
29
|
+
extra_rdoc_files: []
|
30
|
+
|
31
|
+
files:
|
32
|
+
- .gitignore
|
33
|
+
- Gemfile
|
34
|
+
- Rakefile
|
35
|
+
- lib/xvp.rb
|
36
|
+
- lib/xvp/encryption.rb
|
37
|
+
- lib/xvp/version.rb
|
38
|
+
- xvp.gemspec
|
39
|
+
has_rdoc: true
|
40
|
+
homepage: https://github.com/morellon/xvp
|
41
|
+
licenses: []
|
42
|
+
|
43
|
+
post_install_message:
|
44
|
+
rdoc_options: []
|
45
|
+
|
46
|
+
require_paths:
|
47
|
+
- lib
|
48
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
49
|
+
none: false
|
50
|
+
requirements:
|
51
|
+
- - ">="
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
hash: 3
|
54
|
+
segments:
|
55
|
+
- 0
|
56
|
+
version: "0"
|
57
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
58
|
+
none: false
|
59
|
+
requirements:
|
60
|
+
- - ">="
|
61
|
+
- !ruby/object:Gem::Version
|
62
|
+
hash: 3
|
63
|
+
segments:
|
64
|
+
- 0
|
65
|
+
version: "0"
|
66
|
+
requirements: []
|
67
|
+
|
68
|
+
rubyforge_project: xvp
|
69
|
+
rubygems_version: 1.3.7
|
70
|
+
signing_key:
|
71
|
+
specification_version: 3
|
72
|
+
summary: XVP password encryption for ruby
|
73
|
+
test_files: []
|
74
|
+
|