passbox 2.0.0 → 2.0.2
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.
- checksums.yaml +4 -4
- data/bin/passbox +4 -0
- data/lib/passbox/aes.rb +1 -1
- data/lib/passbox/helpers/generator.rb +49 -0
- data/lib/passbox/helpers/strings.rb +1 -0
- data/lib/passbox/init.rb +3 -3
- data/lib/passbox/version +1 -1
- data/lib/passbox.rb +1 -0
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 90ceafe15e91672b29f6b5bfe56635e1201418f09ac29052f144dbdadb71b26e
|
4
|
+
data.tar.gz: 669582b1329e58ed3a6a2150c0c988ef323abb7cfa3f5a4bb3c229b229d3bcf1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d3e16665f6b58dffd624d2504e24ef783ce74143c0684d9f773b587f5fe40234422fe87d98dfdf7fd996ae6de3d662aac1af0ce1dc0b5a99fd36978e10dfc74c
|
7
|
+
data.tar.gz: 5200997df9adb2237e60634975447c2190efcdcd9591acea17d9db019c27816e522e4f3c81973fdf0b12232d6dd7477d349898092c7f9f6030bdf6d0d57c602c
|
data/bin/passbox
CHANGED
@@ -30,6 +30,8 @@ def print_help
|
|
30
30
|
|
31
31
|
-, delete delete an account from passbox.
|
32
32
|
Usage: passbox delete | passbox del | passbox -
|
33
|
+
|
34
|
+
genpass Generates a secure password of chosen size
|
33
35
|
|
34
36
|
HELP
|
35
37
|
end
|
@@ -55,6 +57,8 @@ elsif ARGV.length == 1
|
|
55
57
|
delete_pass
|
56
58
|
when "list", "ls"
|
57
59
|
list_of_accounts
|
60
|
+
when "genpass"
|
61
|
+
generate
|
58
62
|
else
|
59
63
|
puts "Invalid Command. Enter 'passbox help' to show usage.".red
|
60
64
|
end
|
data/lib/passbox/aes.rb
CHANGED
@@ -18,7 +18,7 @@ module Passbox
|
|
18
18
|
decipher = OpenSSL::Cipher::AES256.new(:CTR)
|
19
19
|
decipher.decrypt
|
20
20
|
decipher.iv = data[0..15]
|
21
|
-
data = data[16
|
21
|
+
data = data[16..-1]
|
22
22
|
decipher.key = key[0..31]
|
23
23
|
decrypted_data = decipher.update(data) + decipher.final
|
24
24
|
return decrypted_data
|
@@ -0,0 +1,49 @@
|
|
1
|
+
module Passbox
|
2
|
+
|
3
|
+
def generator_init
|
4
|
+
chars = "aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWXyYzZ"
|
5
|
+
nums = "0123456789"
|
6
|
+
specials = "!@#$^&*()%,+-_.:;<>?/[]{}~|"
|
7
|
+
|
8
|
+
inclusion = chars+nums
|
9
|
+
print "Need Special characters in your password? (Y/n): "
|
10
|
+
special_chars_flag = user_input.downcase
|
11
|
+
inclusion = inclusion + specials if special_chars_flag == "y"
|
12
|
+
return inclusion
|
13
|
+
end
|
14
|
+
|
15
|
+
def password_size
|
16
|
+
attempts = 0
|
17
|
+
while(true)
|
18
|
+
if attempts == 3
|
19
|
+
print too_many_attempts.bold.red
|
20
|
+
exit(0)
|
21
|
+
end
|
22
|
+
print "Password length(8-25): "
|
23
|
+
passlen = user_input.to_i
|
24
|
+
if (passlen >= 8 && passlen <= 25)
|
25
|
+
return passlen
|
26
|
+
else
|
27
|
+
print invalid_input.red
|
28
|
+
attempts = attempts+1
|
29
|
+
next
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
def generate
|
35
|
+
set = generator_init.split("")
|
36
|
+
length = password_size
|
37
|
+
pwd = []
|
38
|
+
length.times do
|
39
|
+
i = rand(set.size-1)
|
40
|
+
set = set.shuffle
|
41
|
+
char = set[i]
|
42
|
+
set.delete(char)
|
43
|
+
pwd.push(char)
|
44
|
+
end
|
45
|
+
print "\nPassword is: #{pwd.join("")}\n\n"
|
46
|
+
end
|
47
|
+
|
48
|
+
|
49
|
+
end
|
data/lib/passbox/init.rb
CHANGED
@@ -8,8 +8,8 @@ module Passbox
|
|
8
8
|
def init
|
9
9
|
pass256=""
|
10
10
|
|
11
|
-
if (Dir.
|
12
|
-
if(File.
|
11
|
+
if (Dir.exist?($pbdir))
|
12
|
+
if(File.exist?($passfile))
|
13
13
|
print pb_already_setup
|
14
14
|
return
|
15
15
|
else
|
@@ -23,7 +23,7 @@ module Passbox
|
|
23
23
|
end
|
24
24
|
|
25
25
|
def check_passbox
|
26
|
-
if !File.
|
26
|
+
if !File.exist?($passfile)
|
27
27
|
print pb_not_setup
|
28
28
|
exit(0)
|
29
29
|
end
|
data/lib/passbox/version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.0.
|
1
|
+
2.0.2
|
data/lib/passbox.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: passbox
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kaushal Rupani
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-12-04 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: A gem to store and manage password offline, encrypted using AES 256 strong
|
14
14
|
encryption.
|
@@ -30,6 +30,7 @@ files:
|
|
30
30
|
- lib/passbox/crud/read.rb
|
31
31
|
- lib/passbox/crud/update.rb
|
32
32
|
- lib/passbox/helpers/colourize.rb
|
33
|
+
- lib/passbox/helpers/generator.rb
|
33
34
|
- lib/passbox/helpers/options.rb
|
34
35
|
- lib/passbox/helpers/strings.rb
|
35
36
|
- lib/passbox/init.rb
|
@@ -53,7 +54,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
53
54
|
- !ruby/object:Gem::Version
|
54
55
|
version: '0'
|
55
56
|
requirements: []
|
56
|
-
rubygems_version: 3.
|
57
|
+
rubygems_version: 3.4.10
|
57
58
|
signing_key:
|
58
59
|
specification_version: 4
|
59
60
|
summary: 'PassBox gem : AES encrypted offline password manager'
|