CryptoDataHub 0.12.6__py3-none-any.whl

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.
Files changed (70) hide show
  1. CryptoDataHub-0.12.6.dist-info/LICENSE.txt +373 -0
  2. CryptoDataHub-0.12.6.dist-info/METADATA +119 -0
  3. CryptoDataHub-0.12.6.dist-info/RECORD +70 -0
  4. CryptoDataHub-0.12.6.dist-info/WHEEL +5 -0
  5. CryptoDataHub-0.12.6.dist-info/top_level.txt +1 -0
  6. cryptodatahub/__init__.py +0 -0
  7. cryptodatahub/__setup__.py +10 -0
  8. cryptodatahub/common/__init__.py +0 -0
  9. cryptodatahub/common/algorithm.py +164 -0
  10. cryptodatahub/common/attack-named.json +74 -0
  11. cryptodatahub/common/attack-type.json +58 -0
  12. cryptodatahub/common/authentication.json +113 -0
  13. cryptodatahub/common/block-cipher-mode.json +75 -0
  14. cryptodatahub/common/block-cipher.json +474 -0
  15. cryptodatahub/common/certificate-transparency-log.json +2394 -0
  16. cryptodatahub/common/client.json +20 -0
  17. cryptodatahub/common/dhparam-well-known.json +1975 -0
  18. cryptodatahub/common/ecparam-well-known.json +1868 -0
  19. cryptodatahub/common/entity.json +269 -0
  20. cryptodatahub/common/entity.py +110 -0
  21. cryptodatahub/common/exception.py +28 -0
  22. cryptodatahub/common/grade.py +200 -0
  23. cryptodatahub/common/hash.json +273 -0
  24. cryptodatahub/common/key-exchange.json +140 -0
  25. cryptodatahub/common/key.py +571 -0
  26. cryptodatahub/common/mac.json +404 -0
  27. cryptodatahub/common/named-group.json +902 -0
  28. cryptodatahub/common/parameter.py +149 -0
  29. cryptodatahub/common/root-certificate.json +19240 -0
  30. cryptodatahub/common/server.json +56 -0
  31. cryptodatahub/common/signature.json +233 -0
  32. cryptodatahub/common/standard.json +57 -0
  33. cryptodatahub/common/stores.py +323 -0
  34. cryptodatahub/common/types.py +524 -0
  35. cryptodatahub/common/utils.py +112 -0
  36. cryptodatahub/common/vulnerability.json +2 -0
  37. cryptodatahub/dnsrec/__init__.py +0 -0
  38. cryptodatahub/dnsrec/algorithm.json +114 -0
  39. cryptodatahub/dnsrec/algorithm.py +87 -0
  40. cryptodatahub/dnsrec/digest-type.json +26 -0
  41. cryptodatahub/dnsrec/rr-type.json +805 -0
  42. cryptodatahub/ssh/__init__.py +0 -0
  43. cryptodatahub/ssh/algorithm.py +194 -0
  44. cryptodatahub/ssh/compression-algorithm.json +24 -0
  45. cryptodatahub/ssh/elliptic-curve-identifier.json +50 -0
  46. cryptodatahub/ssh/encryption-algorithm.json +587 -0
  47. cryptodatahub/ssh/host-key-algorithm.json +482 -0
  48. cryptodatahub/ssh/kex-algorithm.json +709 -0
  49. cryptodatahub/ssh/mac-algorithm.json +566 -0
  50. cryptodatahub/tls/__init__.py +0 -0
  51. cryptodatahub/tls/algorithm.py +324 -0
  52. cryptodatahub/tls/certificate-compression-algorithm.json +14 -0
  53. cryptodatahub/tls/cipher-kind.json +171 -0
  54. cryptodatahub/tls/cipher-suite-extension.json +10 -0
  55. cryptodatahub/tls/cipher-suite.json +5098 -0
  56. cryptodatahub/tls/client.json +4757 -0
  57. cryptodatahub/tls/client.py +220 -0
  58. cryptodatahub/tls/compression-method.json +20 -0
  59. cryptodatahub/tls/ec-point-format.json +20 -0
  60. cryptodatahub/tls/extension-type.json +282 -0
  61. cryptodatahub/tls/grease-one-byte.json +34 -0
  62. cryptodatahub/tls/grease-two-byte.json +66 -0
  63. cryptodatahub/tls/hash-and-signature-algorithm.json +266 -0
  64. cryptodatahub/tls/named-curve.json +292 -0
  65. cryptodatahub/tls/next-protocol-name.json +20 -0
  66. cryptodatahub/tls/protocol-name.json +71 -0
  67. cryptodatahub/tls/psk-key-exchange-mode.json +10 -0
  68. cryptodatahub/tls/token-binding-paramater.json +14 -0
  69. cryptodatahub/tls/version.json +154 -0
  70. cryptodatahub/tls/version.py +17 -0
@@ -0,0 +1,164 @@
1
+ # -*- coding: utf-8 -*-
2
+
3
+ import enum
4
+ import six
5
+
6
+ import attr
7
+
8
+ from cryptodatahub.common.grade import (
9
+ AttackType,
10
+ Grade,
11
+ GradeableComplex,
12
+ GradeableVulnerabilities,
13
+ Vulnerability,
14
+ )
15
+ from cryptodatahub.common.types import (
16
+ CryptoDataEnumBase,
17
+ CryptoDataEnumOIDBase,
18
+ CryptoDataParamsEnumString,
19
+ CryptoDataParamsNamed,
20
+ CryptoDataParamsOIDOptional,
21
+ convert_enum,
22
+ )
23
+
24
+
25
+ @attr.s(frozen=True)
26
+ class AuthenticationParams(CryptoDataParamsOIDOptional, GradeableVulnerabilities):
27
+ anonymous = attr.ib(validator=attr.validators.instance_of(bool))
28
+
29
+ @classmethod
30
+ def get_gradeable_name(cls):
31
+ return 'authentication'
32
+
33
+
34
+ @attr.s(frozen=True)
35
+ class BlockCipherParams(CryptoDataParamsNamed, GradeableVulnerabilities):
36
+ key_size = attr.ib(validator=attr.validators.instance_of(int))
37
+ block_size = attr.ib(validator=attr.validators.optional(attr.validators.instance_of(int)))
38
+
39
+ @classmethod
40
+ def get_gradeable_name(cls):
41
+ return 'block cipher'
42
+
43
+
44
+ @attr.s(frozen=True)
45
+ class BlockCipherModeParams(CryptoDataParamsNamed, GradeableVulnerabilities):
46
+ @classmethod
47
+ def get_gradeable_name(cls):
48
+ return 'block cipher mode'
49
+
50
+
51
+ @attr.s(frozen=True)
52
+ class HashParams(CryptoDataParamsOIDOptional, GradeableVulnerabilities):
53
+ digest_size = attr.ib(validator=attr.validators.instance_of(int))
54
+
55
+ @classmethod
56
+ def get_gradeable_name(cls):
57
+ return 'hash'
58
+
59
+
60
+ @attr.s(frozen=True)
61
+ class KeyExchangeParams(CryptoDataParamsNamed, GradeableVulnerabilities):
62
+ forward_secret = attr.ib(validator=attr.validators.instance_of(bool))
63
+
64
+ @classmethod
65
+ def get_gradeable_name(cls):
66
+ return 'key exchange'
67
+
68
+
69
+ NamedGroupType = enum.Enum('NamedGroupType', 'ELLIPTIC_CURVE FINITE_FIELD HYBRID_PQS')
70
+
71
+
72
+ @attr.s(frozen=True)
73
+ class NamedGroupParams(CryptoDataParamsOIDOptional, GradeableVulnerabilities):
74
+ size = attr.ib(validator=attr.validators.instance_of(int))
75
+ group_type = attr.ib(
76
+ converter=convert_enum(NamedGroupType),
77
+ validator=attr.validators.instance_of(NamedGroupType),
78
+ )
79
+
80
+ @classmethod
81
+ def get_gradeable_name(cls):
82
+ return 'named group'
83
+
84
+
85
+ Authentication = CryptoDataEnumOIDBase('Authentication', CryptoDataEnumOIDBase.get_json_records(AuthenticationParams))
86
+ BlockCipher = CryptoDataEnumBase('BlockCipher', CryptoDataEnumBase.get_json_records(BlockCipherParams))
87
+ BlockCipherMode = CryptoDataEnumBase('BlockCipherMode', CryptoDataEnumBase.get_json_records(BlockCipherModeParams))
88
+ Hash = CryptoDataEnumOIDBase('Hash', CryptoDataEnumOIDBase.get_json_records(HashParams))
89
+ KeyExchange = CryptoDataEnumBase('KeyExchange', CryptoDataEnumBase.get_json_records(KeyExchangeParams))
90
+ NamedGroup = CryptoDataEnumOIDBase('NamedGroup', CryptoDataEnumOIDBase.get_json_records(NamedGroupParams))
91
+
92
+
93
+ @attr.s(frozen=True)
94
+ class MACParams(CryptoDataParamsOIDOptional, GradeableVulnerabilities):
95
+ digest_size = attr.ib(validator=attr.validators.optional(attr.validators.instance_of(int)))
96
+ hash_algorithm = attr.ib(validator=attr.validators.optional(attr.validators.instance_of((Hash, six.string_types))))
97
+
98
+ @classmethod
99
+ def get_gradeable_name(cls):
100
+ return 'MAC'
101
+
102
+ def __attrs_post_init__(self):
103
+ if (self.digest_size is None) == (self.hash_algorithm is None):
104
+ raise ValueError()
105
+
106
+ if isinstance(self.hash_algorithm, six.string_types):
107
+ object.__setattr__(self, 'hash_algorithm', Hash[self.hash_algorithm])
108
+
109
+ if self.digest_size is None:
110
+ object.__setattr__(self, 'digest_size', self.hash_algorithm.value.digest_size)
111
+
112
+ attr.validate(self)
113
+
114
+
115
+ MAC = CryptoDataEnumOIDBase('MAC', CryptoDataEnumOIDBase.get_json_records(MACParams))
116
+
117
+
118
+ @attr.s(frozen=True)
119
+ class MACModeParams(CryptoDataParamsEnumString, GradeableVulnerabilities):
120
+ name = attr.ib(validator=attr.validators.instance_of(six.string_types))
121
+
122
+ @classmethod
123
+ def get_gradeable_name(cls):
124
+ return 'MAC mode'
125
+
126
+
127
+ class MACMode(enum.Enum):
128
+ ENCRYPT_THEN_MAC = MACModeParams(
129
+ code='encrypt_then_mac',
130
+ name='encrypt then MAC',
131
+ vulnerabilities=[],
132
+ )
133
+ ENCRYPT_AND_MAC = MACModeParams(
134
+ code='encrypt_and_mac',
135
+ name='encrypt and MAC',
136
+ vulnerabilities=[
137
+ Vulnerability(attack_type=AttackType.FORGERY_ATTACK, grade=Grade.WEAK, named=None),
138
+ ],
139
+ )
140
+ MAC_THEN_ENCRYP = MACModeParams(
141
+ code='mac_then_encrypt',
142
+ name='MAC then encrypt',
143
+ vulnerabilities=[],
144
+ )
145
+
146
+
147
+ @attr.s(frozen=True)
148
+ class SignatureParams(CryptoDataParamsOIDOptional, GradeableComplex):
149
+ key_type = attr.ib(
150
+ converter=convert_enum(Authentication),
151
+ validator=attr.validators.instance_of(Authentication),
152
+ )
153
+ hash_algorithm = attr.ib(
154
+ converter=convert_enum(Hash),
155
+ validator=attr.validators.optional(attr.validators.instance_of(Hash)),
156
+ )
157
+
158
+ def __attrs_post_init__(self):
159
+ object.__setattr__(self, 'gradeables', [self.hash_algorithm.value])
160
+
161
+ attr.validate(self)
162
+
163
+
164
+ Signature = CryptoDataEnumOIDBase('Signature', CryptoDataEnumOIDBase.get_json_records(SignatureParams))
@@ -0,0 +1,74 @@
1
+ {
2
+ "CRIME": {
3
+ "name": "CRIME",
4
+ "long_name": "Compression Ratio Info-leak Made Easy",
5
+ "grade": "WEAK",
6
+ "attack_type": "COMPRESSION_ORACLE"
7
+ },
8
+ "DHEAT_ATTACK": {
9
+ "name": "D(HE)at attack",
10
+ "long_name": null,
11
+ "grade": "WEAK",
12
+ "attack_type": "DOS_ATTACK"
13
+ },
14
+ "DROWN_ATTACK": {
15
+ "name": "DROWN",
16
+ "long_name": "Decrypting RSA with Obsolete and Weakened eNcryption",
17
+ "grade": "INSECURE",
18
+ "attack_type": "MITM"
19
+ },
20
+ "EXPORT_GRADE": {
21
+ "name": "export-grade",
22
+ "long_name": null,
23
+ "grade": "INSECURE",
24
+ "attack_type": "MITM"
25
+ },
26
+ "FREAK": {
27
+ "name": "FREAK",
28
+ "long_name": "Factoring RSA Export Keys",
29
+ "grade": "INSECURE",
30
+ "attack_type": "MITM"
31
+ },
32
+ "LUCKY13": {
33
+ "name": "Lucky Thirteen attack",
34
+ "long_name": null,
35
+ "grade": "DEPRECATED",
36
+ "attack_type": "TIMING"
37
+ },
38
+ "NOFS": {
39
+ "name": "non-forward secret",
40
+ "long_name": null,
41
+ "grade": "DEPRECATED",
42
+ "attack_type": "MITM"
43
+ },
44
+ "NOMORE": {
45
+ "name": "NOMORE attack",
46
+ "long_name": "Numerous Occurrence MOnitoring & Recovery Exploit",
47
+ "grade": "INSECURE",
48
+ "attack_type": null
49
+ },
50
+ "POODLE": {
51
+ "name": "POODLE",
52
+ "long_name": "Padding Oracle On Downgraded Legacy Encryption",
53
+ "grade": "INSECURE",
54
+ "attack_type": "PADDING_ORACLE"
55
+ },
56
+ "SWEET32": {
57
+ "name": "Sweet32",
58
+ "long_name": null,
59
+ "grade": "INSECURE",
60
+ "attack_type": "BIRTHDAY"
61
+ },
62
+ "SHATTERED": {
63
+ "name": "SHAttered attack",
64
+ "long_name": null,
65
+ "grade": "INSECURE",
66
+ "attack_type": "COLLISION"
67
+ },
68
+ "WEAK_DH": {
69
+ "name": "weak DH",
70
+ "long_name": "weak Diffie-Hellman",
71
+ "grade": "INSECURE",
72
+ "attack_type": "INTEGER_FACTORIZATION"
73
+ }
74
+ }
@@ -0,0 +1,58 @@
1
+ {
2
+ "BIRTHDAY": {
3
+ "name": "birthday attack",
4
+ "long_name": null
5
+ },
6
+ "BRUTE_FORCE": {
7
+ "name": "brute-force attack",
8
+ "long_name": null
9
+ },
10
+ "CHOSEN_PLAINTEXT_ATTACK": {
11
+ "name": "chosen-plaintext attack",
12
+ "long_name": null
13
+ },
14
+ "COLLISION": {
15
+ "name": "collision attack",
16
+ "long_name": null
17
+ },
18
+ "COMPRESSION_ORACLE": {
19
+ "name": "compression oracle attack",
20
+ "long_name": null
21
+ },
22
+ "DOS_ATTACK": {
23
+ "name": "(D)DoS attack",
24
+ "long_name": "(distributed) denial-of-service attack"
25
+ },
26
+ "DISCRETE_LOGARITHM": {
27
+ "name": "discrete logarithm",
28
+ "long_name": null
29
+ },
30
+ "FORGERY_ATTACK": {
31
+ "name": "forgery attack",
32
+ "long_name": null
33
+ },
34
+ "INTEGER_FACTORIZATION": {
35
+ "name": "integer factorization",
36
+ "long_name": null
37
+ },
38
+ "MITM": {
39
+ "name": "MITM attack",
40
+ "long_name": "man-in-the-middle attack"
41
+ },
42
+ "PADDING_ORACLE": {
43
+ "name": "padding oracle attack",
44
+ "long_name": null
45
+ },
46
+ "REUSED_KEY_ATTACK": {
47
+ "name": "reused key attack",
48
+ "long_name": null
49
+ },
50
+ "SNIFFING": {
51
+ "name": "sniffing attack",
52
+ "long_name": null
53
+ },
54
+ "TIMING": {
55
+ "name": "timing attack",
56
+ "long_name": null
57
+ }
58
+ }
@@ -0,0 +1,113 @@
1
+ {
2
+ "ANONYMOUS": {
3
+ "name": "anon",
4
+ "long_name": "anonymous",
5
+ "oid": null,
6
+ "vulnerabilities": [
7
+ {
8
+ "attack_type": "MITM",
9
+ "grade": "INSECURE",
10
+ "named": null
11
+ }
12
+ ],
13
+ "anonymous": true
14
+ },
15
+ "DSS": {
16
+ "name": "DSS",
17
+ "long_name": "Digital Signature Standard",
18
+ "oid": "1.2.840.10040.4.1",
19
+ "vulnerabilities": [],
20
+ "anonymous": false
21
+ },
22
+ "ECDSA": {
23
+ "name": "ECDSA",
24
+ "long_name": "Elliptic Curve Digital Signature Algorithm",
25
+ "oid": "1.2.840.10045.2.1",
26
+ "vulnerabilities": [],
27
+ "anonymous": false
28
+ },
29
+ "FORTEZZA": {
30
+ "name": "Fortezza",
31
+ "long_name": null,
32
+ "oid": null,
33
+ "vulnerabilities": null,
34
+ "anonymous": false
35
+ },
36
+ "GOST2814789": {
37
+ "name": "GOST 28147-89",
38
+ "long_name": null,
39
+ "oid": "1.2.643.2.2.21",
40
+ "vulnerabilities": null,
41
+ "anonymous": false
42
+ },
43
+ "GOST_R3410_01": {
44
+ "name": "GOST R 34.10-2001",
45
+ "long_name": null,
46
+ "oid": "1.2.643.2.2.19",
47
+ "vulnerabilities": null,
48
+ "anonymous": false
49
+ },
50
+ "GOST_R3410_12_256": {
51
+ "name": "GOST R 34.10-2012 (256)",
52
+ "long_name": null,
53
+ "oid": "1.2.643.7.1.1.1.1",
54
+ "vulnerabilities": null,
55
+ "anonymous": false
56
+ },
57
+ "GOST_R3410_12_512": {
58
+ "name": "GOST R 34.10-2012 (512)",
59
+ "long_name": null,
60
+ "oid": "1.2.643.7.1.1.1.2",
61
+ "vulnerabilities": null,
62
+ "anonymous": false
63
+ },
64
+ "GOST_R3410_94": {
65
+ "name": "GOST R 34.10-94",
66
+ "long_name": null,
67
+ "oid": "1.2.643.2.2.20",
68
+ "vulnerabilities": null,
69
+ "anonymous": false
70
+ },
71
+ "KRB5": {
72
+ "name": "KRB5",
73
+ "long_name": "Kerberos V5",
74
+ "oid": null,
75
+ "vulnerabilities": null,
76
+ "anonymous": false
77
+ },
78
+ "PSK": {
79
+ "name": "PSK",
80
+ "long_name": "Pre-shared Key",
81
+ "oid": null,
82
+ "vulnerabilities": null,
83
+ "anonymous": false
84
+ },
85
+ "RSA": {
86
+ "name": "RSA",
87
+ "long_name": "Rivest-Shamir-Adleman",
88
+ "oid": "1.2.840.113549.1.1.1",
89
+ "vulnerabilities": [],
90
+ "anonymous": false
91
+ },
92
+ "SRP": {
93
+ "name": "SRP",
94
+ "long_name": "Secure Remote Password",
95
+ "oid": null,
96
+ "vulnerabilities": null,
97
+ "anonymous": false
98
+ },
99
+ "EDDSA": {
100
+ "name": "EDDSA",
101
+ "long_name": "Edwards-curve Digital Signature Algorithm",
102
+ "oid": null,
103
+ "vulnerabilities": [],
104
+ "anonymous": false
105
+ },
106
+ "XMSS": {
107
+ "name": "XMSS",
108
+ "long_name": "eXtended Merkle Signature Scheme",
109
+ "oid": null,
110
+ "vulnerabilities": [],
111
+ "anonymous": false
112
+ }
113
+ }
@@ -0,0 +1,75 @@
1
+ {
2
+ "CBC": {
3
+ "name": "CBC",
4
+ "long_name": "cipher block chaining",
5
+ "vulnerabilities": [
6
+ {
7
+ "attack_type": "PADDING_ORACLE",
8
+ "grade": "WEAK",
9
+ "named": "POODLE"
10
+ }
11
+ ]
12
+ },
13
+ "CCM": {
14
+ "name": "CCM",
15
+ "long_name": "counter with CBC-MAC",
16
+ "vulnerabilities": []
17
+ },
18
+ "CCM_8": {
19
+ "name": "CCM-8",
20
+ "long_name": "counter with CBC-MAC (8)",
21
+ "vulnerabilities": []
22
+ },
23
+ "CFB": {
24
+ "name": "CFB",
25
+ "long_name": "cipher feedback",
26
+ "vulnerabilities": null
27
+ },
28
+ "CNT": {
29
+ "name": "CNT",
30
+ "long_name": "GOST counter",
31
+ "vulnerabilities": null
32
+ },
33
+ "CTR": {
34
+ "name": "CTR",
35
+ "long_name": "counter",
36
+ "vulnerabilities": []
37
+ },
38
+ "ECB": {
39
+ "name": "ECB",
40
+ "long_name": "electronic codebook",
41
+ "vulnerabilities": [
42
+ {
43
+ "attack_type": "CHOSEN_PLAINTEXT_ATTACK",
44
+ "grade": "INSECURE",
45
+ "named": null
46
+ }
47
+ ]
48
+ },
49
+ "EAX": {
50
+ "name": "EAX",
51
+ "long_name": "encrypt-then-authenticate-then-translate",
52
+ "vulnerabilities": null
53
+ },
54
+ "GCM": {
55
+ "name": "GCM",
56
+ "long_name": "Galois/counter mode",
57
+ "vulnerabilities": []
58
+ },
59
+ "MGM": {
60
+ "name": "MGM",
61
+ "long_name": "GOST Magma",
62
+ "vulnerabilities": null
63
+ },
64
+ "OFB": {
65
+ "name": "OFB",
66
+ "long_name": "output feedback",
67
+ "vulnerabilities": [
68
+ {
69
+ "attack_type": "REUSED_KEY_ATTACK",
70
+ "grade": "WEAK",
71
+ "named": null
72
+ }
73
+ ]
74
+ }
75
+ }