ip_anonymizer 0.2.0 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/LICENSE.txt +1 -1
- data/lib/ip_anonymizer/version.rb +1 -1
- data/lib/ip_anonymizer.rb +5 -5
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8fca3d0e40cc438ec8f6ed699b844f7d6e731f8b3604963afedd62a3aeb8d635
|
4
|
+
data.tar.gz: 90057058cce03ec1c9fa647891f699ed22cac1caa9b9af3f84aa664760c64294
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ef7802170105a8e1d56074b3463b898dc44e585feb9c9d0e10199fc7e22e1489e779be3a928321228762af92ff9c0513350f99b39ddb76af49ed9031ee27fca7
|
7
|
+
data.tar.gz: 4fb6532abee3a955048982759c822dca5c3408354965cbccc7d8b320197c17d2993c07d75221c2d55cda2dc0d5747218349f2f64b5c0dd3f530a9080ba1ac7d5
|
data/CHANGELOG.md
CHANGED
data/LICENSE.txt
CHANGED
data/lib/ip_anonymizer.rb
CHANGED
@@ -3,9 +3,9 @@ require "ipaddr"
|
|
3
3
|
require "openssl"
|
4
4
|
|
5
5
|
# modules
|
6
|
-
|
7
|
-
|
8
|
-
|
6
|
+
require_relative "ip_anonymizer/hash_ip"
|
7
|
+
require_relative "ip_anonymizer/mask_ip"
|
8
|
+
require_relative "ip_anonymizer/version"
|
9
9
|
|
10
10
|
module IpAnonymizer
|
11
11
|
def self.mask_ip(ip)
|
@@ -24,7 +24,7 @@ module IpAnonymizer
|
|
24
24
|
key_len = addr.ipv4? ? 4 : 16
|
25
25
|
family = addr.ipv4? ? Socket::AF_INET : Socket::AF_INET6
|
26
26
|
|
27
|
-
keyed_hash = OpenSSL::
|
28
|
-
IPAddr.new(keyed_hash.bytes.inject {|a, b| (a << 8) + b }, family).to_s
|
27
|
+
keyed_hash = OpenSSL::KDF.pbkdf2_hmac(addr.to_s, salt: key, iterations: iterations, length: key_len, hash: "sha256")
|
28
|
+
IPAddr.new(keyed_hash.bytes.inject { |a, b| (a << 8) + b }, family).to_s
|
29
29
|
end
|
30
30
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ip_anonymizer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrew Kane
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-06-24 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description:
|
14
14
|
email: andrew@ankane.org
|
@@ -35,14 +35,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
35
35
|
requirements:
|
36
36
|
- - ">="
|
37
37
|
- !ruby/object:Gem::Version
|
38
|
-
version: '
|
38
|
+
version: '3.1'
|
39
39
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
40
40
|
requirements:
|
41
41
|
- - ">="
|
42
42
|
- !ruby/object:Gem::Version
|
43
43
|
version: '0'
|
44
44
|
requirements: []
|
45
|
-
rubygems_version: 3.
|
45
|
+
rubygems_version: 3.5.11
|
46
46
|
signing_key:
|
47
47
|
specification_version: 4
|
48
48
|
summary: IP address anonymizer for Ruby and Rails
|