cracknuts-squirrel 0.1.0a1__tar.gz
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.
- cracknuts_squirrel-0.1.0a1/LICENSE +175 -0
- cracknuts_squirrel-0.1.0a1/PKG-INFO +31 -0
- cracknuts_squirrel-0.1.0a1/README.md +10 -0
- cracknuts_squirrel-0.1.0a1/pyproject.toml +51 -0
- cracknuts_squirrel-0.1.0a1/setup.cfg +4 -0
- cracknuts_squirrel-0.1.0a1/src/cracknuts_squirrel/__init__.py +1 -0
- cracknuts_squirrel-0.1.0a1/src/cracknuts_squirrel/cpa_analysis.py +189 -0
- cracknuts_squirrel-0.1.0a1/src/cracknuts_squirrel/preprocessingBasic.py +21 -0
- cracknuts_squirrel-0.1.0a1/src/cracknuts_squirrel/staticalgin.py +105 -0
- cracknuts_squirrel-0.1.0a1/src/cracknuts_squirrel/traceIO.py +167 -0
- cracknuts_squirrel-0.1.0a1/src/cracknuts_squirrel.egg-info/PKG-INFO +31 -0
- cracknuts_squirrel-0.1.0a1/src/cracknuts_squirrel.egg-info/SOURCES.txt +13 -0
- cracknuts_squirrel-0.1.0a1/src/cracknuts_squirrel.egg-info/dependency_links.txt +1 -0
- cracknuts_squirrel-0.1.0a1/src/cracknuts_squirrel.egg-info/requires.txt +9 -0
- cracknuts_squirrel-0.1.0a1/src/cracknuts_squirrel.egg-info/top_level.txt +1 -0
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
|
|
2
|
+
Apache License
|
|
3
|
+
Version 2.0, January 2004
|
|
4
|
+
http://www.apache.org/licenses/
|
|
5
|
+
|
|
6
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
7
|
+
|
|
8
|
+
1. Definitions.
|
|
9
|
+
|
|
10
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
11
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
12
|
+
|
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
14
|
+
the copyright owner that is granting the License.
|
|
15
|
+
|
|
16
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
17
|
+
other entities that control, are controlled by, or are under common
|
|
18
|
+
control with that entity. For the purposes of this definition,
|
|
19
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
20
|
+
direction or management of such entity, whether by contract or
|
|
21
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
22
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
23
|
+
|
|
24
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
25
|
+
exercising permissions granted by this License.
|
|
26
|
+
|
|
27
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
28
|
+
including but not limited to software source code, documentation
|
|
29
|
+
source, and configuration files.
|
|
30
|
+
|
|
31
|
+
"Object" form shall mean any form resulting from mechanical
|
|
32
|
+
transformation or translation of a Source form, including but
|
|
33
|
+
not limited to compiled object code, generated documentation,
|
|
34
|
+
and conversions to other media types.
|
|
35
|
+
|
|
36
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
37
|
+
Object form, made available under the License, as indicated by a
|
|
38
|
+
copyright notice that is included in or attached to the work
|
|
39
|
+
(an example is provided in the Appendix below).
|
|
40
|
+
|
|
41
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
42
|
+
form, that is based on (or derived from) the Work and for which the
|
|
43
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
47
|
+
the Work and Derivative Works thereof.
|
|
48
|
+
|
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
|
50
|
+
the original version of the Work and any modifications or additions
|
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
52
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
62
|
+
|
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
64
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
65
|
+
subsequently incorporated within the Work.
|
|
66
|
+
|
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
|
73
|
+
|
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
79
|
+
where such license applies only to those patent claims licensable
|
|
80
|
+
by such Contributor that are necessarily infringed by their
|
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
83
|
+
institute patent litigation against any entity (including a
|
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
86
|
+
or contributory patent infringement, then any patent licenses
|
|
87
|
+
granted to You under this License for that Work shall terminate
|
|
88
|
+
as of the date such litigation is filed.
|
|
89
|
+
|
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
92
|
+
modifications, and in Source or Object form, provided that You
|
|
93
|
+
meet the following conditions:
|
|
94
|
+
|
|
95
|
+
(a) You must give any other recipients of the Work or
|
|
96
|
+
Derivative Works a copy of this License; and
|
|
97
|
+
|
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
|
99
|
+
stating that You changed the files; and
|
|
100
|
+
|
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
|
103
|
+
attribution notices from the Source form of the Work,
|
|
104
|
+
excluding those notices that do not pertain to any part of
|
|
105
|
+
the Derivative Works; and
|
|
106
|
+
|
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
|
109
|
+
include a readable copy of the attribution notices contained
|
|
110
|
+
within such NOTICE file, excluding those notices that do not
|
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
|
112
|
+
of the following places: within a NOTICE text file distributed
|
|
113
|
+
as part of the Derivative Works; within the Source form or
|
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
|
115
|
+
within a display generated by the Derivative Works, if and
|
|
116
|
+
wherever such third-party notices normally appear. The contents
|
|
117
|
+
of the NOTICE file are for informational purposes only and
|
|
118
|
+
do not modify the License. You may add Your own attribution
|
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
121
|
+
that such additional attribution notices cannot be construed
|
|
122
|
+
as modifying the License.
|
|
123
|
+
|
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
|
125
|
+
may provide additional or different license terms and conditions
|
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
129
|
+
the conditions stated in this License.
|
|
130
|
+
|
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
134
|
+
this License, without any additional terms or conditions.
|
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
136
|
+
the terms of any separate license agreement you may have executed
|
|
137
|
+
with Licensor regarding such Contributions.
|
|
138
|
+
|
|
139
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
141
|
+
except as required for reasonable and customary use in describing the
|
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
143
|
+
|
|
144
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
|
153
|
+
|
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
|
159
|
+
incidental, or consequential damages of any character arising as a
|
|
160
|
+
result of this License or out of the use or inability to use the
|
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
163
|
+
other commercial damages or losses), even if such Contributor
|
|
164
|
+
has been advised of the possibility of such damages.
|
|
165
|
+
|
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
169
|
+
or other liability obligations and/or rights consistent with this
|
|
170
|
+
License. However, in accepting such obligations, You may act only
|
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
175
|
+
of your accepting any such warranty or additional liability.
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: cracknuts-squirrel
|
|
3
|
+
Version: 0.1.0a1
|
|
4
|
+
Summary: A Python library for side-channel analysis
|
|
5
|
+
Author-email: Dingzb <dingzibiao@gmail.com>
|
|
6
|
+
Maintainer-email: Dingzb <dingzibiao@gmail.com>
|
|
7
|
+
License-Expression: Apache-2.0
|
|
8
|
+
Project-URL: homepage, https://cracknuts.io
|
|
9
|
+
Requires-Python: >=3.12
|
|
10
|
+
Description-Content-Type: text/markdown
|
|
11
|
+
License-File: LICENSE
|
|
12
|
+
Requires-Dist: numpy~=1.26.4
|
|
13
|
+
Requires-Dist: pycryptodome~=3.23.0
|
|
14
|
+
Requires-Dist: zarr~=2.18.2
|
|
15
|
+
Requires-Dist: packaging~=24.1
|
|
16
|
+
Requires-Dist: numba~=0.61.2
|
|
17
|
+
Requires-Dist: dask~=2025.5.1
|
|
18
|
+
Provides-Extra: jupyter
|
|
19
|
+
Requires-Dist: jupyter~=1.1.1; extra == "jupyter"
|
|
20
|
+
Dynamic: license-file
|
|
21
|
+
|
|
22
|
+
# CrackNuts Squirrel
|
|
23
|
+
|
|
24
|
+
## For Developers
|
|
25
|
+
|
|
26
|
+
In the virtual environment, run the following command to install the dependencies:
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
pip install -e .
|
|
30
|
+
pip install -r requirements-dev.txt
|
|
31
|
+
```
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools >= 61.0"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "cracknuts-squirrel"
|
|
7
|
+
description = "A Python library for side-channel analysis"
|
|
8
|
+
dynamic = ["version"]
|
|
9
|
+
requires-python = ">=3.12"
|
|
10
|
+
readme = "README.md"
|
|
11
|
+
license = "Apache-2.0"
|
|
12
|
+
authors = [{ name = "Dingzb", email = "dingzibiao@gmail.com" }]
|
|
13
|
+
maintainers = [{ name = "Dingzb", email = "dingzibiao@gmail.com" }]
|
|
14
|
+
dependencies = [
|
|
15
|
+
"numpy~=1.26.4",
|
|
16
|
+
"pycryptodome~=3.23.0",
|
|
17
|
+
"zarr~=2.18.2",
|
|
18
|
+
"packaging~=24.1",
|
|
19
|
+
"numba~=0.61.2",
|
|
20
|
+
"dask~=2025.5.1"
|
|
21
|
+
]
|
|
22
|
+
|
|
23
|
+
[project.optional-dependencies]
|
|
24
|
+
jupyter = [
|
|
25
|
+
"jupyter~=1.1.1",
|
|
26
|
+
]
|
|
27
|
+
|
|
28
|
+
[project.urls]
|
|
29
|
+
homepage = "https://cracknuts.io"
|
|
30
|
+
|
|
31
|
+
[tool.setuptools.dynamic]
|
|
32
|
+
version = { attr = "cracknuts_squirrel.__version__" }
|
|
33
|
+
|
|
34
|
+
[tool.ruff]
|
|
35
|
+
line-length = 120
|
|
36
|
+
target-version = "py312"
|
|
37
|
+
exclude = ["demo", "tests", "docs"]
|
|
38
|
+
|
|
39
|
+
[tool.ruff.lint]
|
|
40
|
+
extend-select = [
|
|
41
|
+
"F",
|
|
42
|
+
"E",
|
|
43
|
+
"W",
|
|
44
|
+
"UP",
|
|
45
|
+
]
|
|
46
|
+
|
|
47
|
+
[tool.typos.files]
|
|
48
|
+
extend-exclude = [
|
|
49
|
+
"demo",
|
|
50
|
+
"tests"
|
|
51
|
+
]
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "0.1.0-alpha.1"
|
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
import dask.array as da
|
|
2
|
+
import numpy as np
|
|
3
|
+
import numba as nb
|
|
4
|
+
from preprocessingBasic import PPBasic
|
|
5
|
+
from dask.diagnostics import ProgressBar
|
|
6
|
+
import zarr
|
|
7
|
+
from Crypto.Cipher import AES
|
|
8
|
+
|
|
9
|
+
# AES-128 sbox used to compute model values
|
|
10
|
+
AES_SBOX = np.array([99,124,119,123,242,107,111,197,48,1,103,43,254,215,171,118,
|
|
11
|
+
202,130,201,125,250,89,71,240,173,212,162,175,156,164,114,192,
|
|
12
|
+
183,253,147,38,54,63,247,204,52,165,229,241,113,216,49,21,
|
|
13
|
+
4,199,35,195,24,150,5,154,7,18,128,226,235,39,178,117,
|
|
14
|
+
9,131,44,26,27,110,90,160,82,59,214,179,41,227,47,132,
|
|
15
|
+
83,209,0,237,32,252,177,91,106,203,190,57,74,76,88,207,
|
|
16
|
+
208,239,170,251,67,77,51,133,69,249,2,127,80,60,159,168,
|
|
17
|
+
81,163,64,143,146,157,56,245,188,182,218,33,16,255,243,210,
|
|
18
|
+
205,12,19,236,95,151,68,23,196,167,126,61,100,93,25,115,
|
|
19
|
+
96,129,79,220,34,42,144,136,70,238,184,20,222,94,11,219,
|
|
20
|
+
224,50,58,10,73,6,36,92,194,211,172,98,145,149,228,121,
|
|
21
|
+
231,200,55,109,141,213,78,169,108,86,244,234,101,122,174,8,
|
|
22
|
+
186,120,37,46,28,166,180,198,232,221,116,31,75,189,139,138,
|
|
23
|
+
112,62,181,102,72,3,246,14,97,53,87,185,134,193,29,158,
|
|
24
|
+
225,248,152,17,105,217,142,148,155,30,135,233,206,85,40,223,
|
|
25
|
+
140,161,137,13,191,230,66,104,65,153,45,15,176,84,187,22])
|
|
26
|
+
|
|
27
|
+
# Hamming weights of the values 0-255 used for model values
|
|
28
|
+
WEIGHTS = np.array([0,1,1,2,1,2,2,3,1,2,2,3,2,3,3,4,
|
|
29
|
+
1,2,2,3,2,3,3,4,2,3,3,4,3,4,4,5,
|
|
30
|
+
1,2,2,3,2,3,3,4,2,3,3,4,3,4,4,5,
|
|
31
|
+
2,3,3,4,3,4,4,5,3,4,4,5,4,5,5,6,
|
|
32
|
+
1,2,2,3,2,3,3,4,2,3,3,4,3,4,4,5,
|
|
33
|
+
2,3,3,4,3,4,4,5,3,4,4,5,4,5,5,6,
|
|
34
|
+
2,3,3,4,3,4,4,5,3,4,4,5,4,5,5,6,
|
|
35
|
+
3,4,4,5,4,5,5,6,4,5,5,6,5,6,6,7,
|
|
36
|
+
1,2,2,3,2,3,3,4,2,3,3,4,3,4,4,5,
|
|
37
|
+
2,3,3,4,3,4,4,5,3,4,4,5,4,5,5,6,
|
|
38
|
+
2,3,3,4,3,4,4,5,3,4,4,5,4,5,5,6,
|
|
39
|
+
3,4,4,5,4,5,5,6,4,5,5,6,5,6,6,7,
|
|
40
|
+
2,3,3,4,3,4,4,5,3,4,4,5,4,5,5,6,
|
|
41
|
+
3,4,4,5,4,5,5,6,4,5,5,6,5,6,6,7,
|
|
42
|
+
3,4,4,5,4,5,5,6,4,5,5,6,5,6,6,7,
|
|
43
|
+
4,5,5,6,5,6,6,7,5,6,6,7,6,7,7,8],
|
|
44
|
+
np.float32)
|
|
45
|
+
|
|
46
|
+
class CPAAnalysis(PPBasic):
|
|
47
|
+
"""
|
|
48
|
+
AES-CPA分析类,继承自预处理基类PPBasic
|
|
49
|
+
"""
|
|
50
|
+
def __init__(self, input_path=None, output_path=None, byte_pos=list(range(16)), sample_range=(0, None), **kwargs):
|
|
51
|
+
super().__init__(input_path=input_path, output_path=output_path, **kwargs)
|
|
52
|
+
self.byte_pos = byte_pos if isinstance(byte_pos, (list, tuple)) else [byte_pos]
|
|
53
|
+
self.sample_range = sample_range
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
def update(self, traces: np.ndarray, data: np.ndarray):
|
|
58
|
+
# Update the number of rows processed
|
|
59
|
+
self.trace_count += traces.shape[0]
|
|
60
|
+
# Update sample accumulator
|
|
61
|
+
self.sample_sum += np.sum(traces, axis=0)
|
|
62
|
+
# Update sample squared accumulator
|
|
63
|
+
self.sample_sq_sum += np.sum(np.square(traces), axis=0)
|
|
64
|
+
# Update model accumulator
|
|
65
|
+
self.model_sum += np.sum(data, axis=0)
|
|
66
|
+
# Update model squared accumulator
|
|
67
|
+
self.model_sq_sum += np.sum(np.square(data), axis=0)
|
|
68
|
+
data = data.reshape((data.shape[0], -1))
|
|
69
|
+
# Update product accumulator
|
|
70
|
+
self.prod_sum += np.matmul(data.T, traces)
|
|
71
|
+
|
|
72
|
+
def calculate(self):
|
|
73
|
+
# Sample mean computation
|
|
74
|
+
sample_mean = np.divide(self.sample_sum, self.trace_count)
|
|
75
|
+
# Model mean computation
|
|
76
|
+
model_mean = np.divide(self.model_sum, self.trace_count)
|
|
77
|
+
|
|
78
|
+
prod_mean = np.divide(self.prod_sum, self.trace_count)
|
|
79
|
+
# Calculate correlation coefficient numerator
|
|
80
|
+
numerator = np.subtract(prod_mean, model_mean*sample_mean)
|
|
81
|
+
# Calculate correlation coeefficient denominator sample part
|
|
82
|
+
to_sqrt = np.subtract(np.divide(self.sample_sq_sum, self.trace_count), np.square(sample_mean))
|
|
83
|
+
to_sqrt[to_sqrt < 0] = 0
|
|
84
|
+
denom_sample = np.sqrt(to_sqrt)
|
|
85
|
+
# Calculate correlation coefficient denominator model part
|
|
86
|
+
to_sqrt = np.subtract(np.divide(self.model_sq_sum, self.trace_count), np.square(model_mean))
|
|
87
|
+
to_sqrt = np.maximum(to_sqrt, 0)
|
|
88
|
+
denom_model = np.sqrt(to_sqrt)
|
|
89
|
+
|
|
90
|
+
denominator = denom_model*denom_sample
|
|
91
|
+
|
|
92
|
+
denominator[denominator == 0] = 1
|
|
93
|
+
|
|
94
|
+
return np.divide(numerator, denominator)
|
|
95
|
+
|
|
96
|
+
def perform_cpa(self):
|
|
97
|
+
"""执行相关系数分析"""
|
|
98
|
+
store = zarr.DirectoryStore(self.output_path)
|
|
99
|
+
root = zarr.group(store=store, overwrite=True)
|
|
100
|
+
|
|
101
|
+
# correlation = root.create_dataset(
|
|
102
|
+
# '/0/0/correlation',
|
|
103
|
+
# shape=(256, 16, self.sel_num_samples),
|
|
104
|
+
# chunks=(256, 16, 1000)
|
|
105
|
+
# )
|
|
106
|
+
correlation = np.zeros((256, 16, self.sel_num_samples), dtype=np.float32)
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
traces = self.t[:, self.sample_range[0]:self.sample_range[1]]
|
|
110
|
+
|
|
111
|
+
# plaintext_bytes = np.array([pt[self.byte_pos] for pt in self.plaintext[:self.sel_num_traces]])
|
|
112
|
+
plaintext_bytes = self.plaintext[:self.sel_num_traces, :16]
|
|
113
|
+
# key_bytes = np.arange(256)[:, np.newaxis]
|
|
114
|
+
# xor_result = np.bitwise_xor(plaintext_bytes, key_bytes)
|
|
115
|
+
# sbox_output = AES_SBOX[xor_result]
|
|
116
|
+
# hw_matrix = WEIGHTS[sbox_output]
|
|
117
|
+
|
|
118
|
+
# 创建Dask延迟计算任务
|
|
119
|
+
def compute_correlation(key_byte):
|
|
120
|
+
key_byte_array = np.full((self.sel_num_traces, 16), key_byte, dtype=np.uint8)
|
|
121
|
+
xor_result = np.bitwise_xor(plaintext_bytes, key_byte_array)
|
|
122
|
+
sbox_output = AES_SBOX[xor_result]
|
|
123
|
+
hw_matrix = WEIGHTS[sbox_output]
|
|
124
|
+
|
|
125
|
+
# 使用Dask进行延迟计算
|
|
126
|
+
trace_count = da.from_array([self.sel_num_traces], chunks=1)
|
|
127
|
+
sample_sum = da.sum(traces, axis=0)
|
|
128
|
+
model_sum = da.sum(hw_matrix, axis=0)
|
|
129
|
+
prod_sum = da.dot(hw_matrix.T, traces)
|
|
130
|
+
|
|
131
|
+
# 构建计算图
|
|
132
|
+
model_mean = model_sum / trace_count
|
|
133
|
+
sample_mean = sample_sum / trace_count
|
|
134
|
+
|
|
135
|
+
# 调整维度以便广播
|
|
136
|
+
numerator = (prod_sum / trace_count) - (model_mean.reshape(-1, 1) * sample_mean)
|
|
137
|
+
|
|
138
|
+
denom = da.sqrt(
|
|
139
|
+
da.maximum(0, (da.sum(hw_matrix**2)/trace_count - model_mean**2).reshape(-1, 1)) *
|
|
140
|
+
da.maximum(0, (da.sum(traces**2, axis=0)/trace_count - sample_mean**2))
|
|
141
|
+
)
|
|
142
|
+
denom = da.where(denom == 0, 1, denom)
|
|
143
|
+
|
|
144
|
+
return da.divide(numerator, denom)
|
|
145
|
+
|
|
146
|
+
# 并行计算所有密钥字节
|
|
147
|
+
delayed_results = [compute_correlation(kb) for kb in range(256)]
|
|
148
|
+
with ProgressBar():
|
|
149
|
+
futures = da.compute(*delayed_results)
|
|
150
|
+
|
|
151
|
+
# 收集结果
|
|
152
|
+
# correlation = np.zeros((256, self.sel_num_samples), dtype=np.float32)
|
|
153
|
+
for key_byte, result in enumerate(futures):
|
|
154
|
+
correlation[key_byte] = result
|
|
155
|
+
|
|
156
|
+
# 优化后的候选值分析(向量化操作)
|
|
157
|
+
max_indices = np.argmax(np.abs(correlation), axis=2)
|
|
158
|
+
candidates = np.take_along_axis(correlation, max_indices[:, :, np.newaxis], axis=2).squeeze()
|
|
159
|
+
|
|
160
|
+
for j in self.byte_pos:
|
|
161
|
+
# 获取当前字节的最优候选
|
|
162
|
+
best_key = np.abs(candidates[:, j]).argmax()
|
|
163
|
+
print(f'第{j+1}字节密钥: {hex(best_key)} 相关系数: {candidates[best_key, j]:.4f}')
|
|
164
|
+
|
|
165
|
+
# 获取前5候选(向量化版本)
|
|
166
|
+
top5_indices = np.argsort(np.abs(candidates[:, j]))[::-1][:5]
|
|
167
|
+
for rank, idx in enumerate(top5_indices, 1):
|
|
168
|
+
print(f'第{rank}候选值:{hex(idx)},相关系数:{candidates[idx, j]:.4f}')
|
|
169
|
+
print('\n')
|
|
170
|
+
|
|
171
|
+
root.create_dataset(
|
|
172
|
+
'/0/0/correlation',
|
|
173
|
+
data = correlation[:, self.byte_pos, :]
|
|
174
|
+
)
|
|
175
|
+
# 添加元数据
|
|
176
|
+
root.attrs.update({
|
|
177
|
+
"cpa_metadata": {
|
|
178
|
+
"analyzed_byte": self.byte_pos,
|
|
179
|
+
"sample_range": self.sample_range,
|
|
180
|
+
"trace_count": self.sel_num_traces
|
|
181
|
+
}
|
|
182
|
+
})
|
|
183
|
+
|
|
184
|
+
if __name__ == "__main__":
|
|
185
|
+
# 示例用法
|
|
186
|
+
cpa = CPAAnalysis(input_path=r'D:\project\cracknuts\demo\jupyter\dataset\20250521110621.zarr')
|
|
187
|
+
cpa.auto_out_filename()
|
|
188
|
+
cpa.set_range(sample_range=(500, 10000)) # 设置分析的采样点范围
|
|
189
|
+
cpa.perform_cpa()
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
from traceIO import DaskZarrIO
|
|
2
|
+
import dask.array as da
|
|
3
|
+
import os
|
|
4
|
+
|
|
5
|
+
class PPBasic(DaskZarrIO):
|
|
6
|
+
def __init__(self, input_path=None, output_path=None, tile='/0/0/', **kwargs):
|
|
7
|
+
super().__init__(input_path=input_path, output_path=output_path, tile=tile, **kwargs)
|
|
8
|
+
self.out_traces = da.zeros((self.num_traces, self.num_samples), chunks=self.t.chunks)
|
|
9
|
+
|
|
10
|
+
# @staticmethod
|
|
11
|
+
def auto_out_filename(self):
|
|
12
|
+
base_name, ext = os.path.splitext(self.input_path)
|
|
13
|
+
self.output_path = f"{base_name}_{self.__class__.__name__}{ext}"
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
if __name__ == "__main__":
|
|
17
|
+
# 示例用法
|
|
18
|
+
input_path = "E:\\codes\\template\\dataset\\20250221202721.zarr"
|
|
19
|
+
testPP = PPBasic(input_path=input_path)
|
|
20
|
+
testPP.auto_out_filename()
|
|
21
|
+
print(testPP.output_path)
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
from enum import auto
|
|
2
|
+
import dask.array as da
|
|
3
|
+
from preprocessingBasic import PPBasic
|
|
4
|
+
import numba as nb
|
|
5
|
+
import numpy as np
|
|
6
|
+
import scipy as sp
|
|
7
|
+
from tqdm import tqdm
|
|
8
|
+
import zarr
|
|
9
|
+
|
|
10
|
+
class Staticalign(PPBasic):
|
|
11
|
+
"""
|
|
12
|
+
用于侧信道曲线对齐的类,继承自曲线预处理的基类PPBasic
|
|
13
|
+
"""
|
|
14
|
+
|
|
15
|
+
def __init__(self, input_path=None, output_path=None, ref_path=None, ref_index=0, tile='/0/0/', threshold=0, **kwargs):
|
|
16
|
+
"""
|
|
17
|
+
初始化参数
|
|
18
|
+
:param input_paths: 多个输入Zarr文件路径列表
|
|
19
|
+
:param output_path: 输出Zarr文件路径
|
|
20
|
+
:param reference_index: 参考曲线索引
|
|
21
|
+
:param kwargs: 传递给父类的其他参数
|
|
22
|
+
"""
|
|
23
|
+
super().__init__(input_path=input_path, output_path=output_path, tile='/0/0/',**kwargs)
|
|
24
|
+
self.threshold = threshold
|
|
25
|
+
self.ref_path = ref_path
|
|
26
|
+
self.ref_index = ref_index
|
|
27
|
+
|
|
28
|
+
def set_ref(self, ref_range=None, max_shift=0):
|
|
29
|
+
"""
|
|
30
|
+
设置参考曲线
|
|
31
|
+
:param ref_range: 参考曲线范围,默认为(0, num_samples)
|
|
32
|
+
:param max_shift: 最大偏移量
|
|
33
|
+
"""
|
|
34
|
+
if ref_range is None:
|
|
35
|
+
ref_range = (0, self.num_samples)
|
|
36
|
+
if self.ref_path is None:
|
|
37
|
+
ref_path = self.input_path
|
|
38
|
+
self.ref_range = ref_range
|
|
39
|
+
self.max_shift = max_shift
|
|
40
|
+
self.reference_trs = da.from_zarr(ref_path+'/0/0/traces')[self.ref_index, :].compute()
|
|
41
|
+
self.reference = self.reference_trs[ref_range[0]:ref_range[1]]
|
|
42
|
+
self.reference = self.reference[::-1]
|
|
43
|
+
cross = sp.signal.fftconvolve(self.reference_trs, self.reference, mode='valid')
|
|
44
|
+
self._refmaxloc = np.argmax(cross[ref_range[0]:ref_range[1]])
|
|
45
|
+
self._refmaxsize = max(cross[ref_range[0]:ref_range[1]])
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
# @nb.njit(parallel=True)
|
|
49
|
+
def align_curves(self, method='correlation'):
|
|
50
|
+
"""
|
|
51
|
+
:param method: 对齐方法,可选'correlation'(相关性)或'feature'(特征点)
|
|
52
|
+
:return: 对齐后的Dask数组列表
|
|
53
|
+
"""
|
|
54
|
+
store = zarr.DirectoryStore(self.output_path)
|
|
55
|
+
root = zarr.group(store=store, overwrite=True)
|
|
56
|
+
|
|
57
|
+
# 创建traces数据集
|
|
58
|
+
traces = root.create_dataset(
|
|
59
|
+
'/0/0/traces',
|
|
60
|
+
shape=(self.sel_num_traces, self.num_samples)
|
|
61
|
+
)
|
|
62
|
+
plaintext = root.create_dataset(
|
|
63
|
+
'/0/0/plaintext',
|
|
64
|
+
shape=(self.plaintext.shape[0], self.plaintext.shape[1])
|
|
65
|
+
)
|
|
66
|
+
plaintext[self.trace_range[0]:self.trace_range[1]] = self.plaintext[self.trace_range[0]:self.trace_range[1]].compute()
|
|
67
|
+
|
|
68
|
+
# 添加attrs元数据
|
|
69
|
+
root.attrs.update({
|
|
70
|
+
"metadata": {
|
|
71
|
+
"channel_names": ["1"],
|
|
72
|
+
"create_time": 1740140842,
|
|
73
|
+
"data_length": self.plaintext.shape[1],
|
|
74
|
+
"sample_count": self.sel_num_samples,
|
|
75
|
+
"trace_count": self.sel_num_traces,
|
|
76
|
+
"version": "((0, '0.0.1'), (0, '0.0.1'))"
|
|
77
|
+
}
|
|
78
|
+
})
|
|
79
|
+
|
|
80
|
+
for trace in tqdm(range(self.trace_range[0], self.trace_range[1]), desc="对齐进度", unit="trace"):
|
|
81
|
+
|
|
82
|
+
curr_trace = self.t[trace, :]
|
|
83
|
+
# 归一化处理
|
|
84
|
+
norm_trace = (curr_trace - np.mean(curr_trace)) / (np.std(curr_trace) * len(curr_trace))
|
|
85
|
+
norm_ref = (self.reference - np.mean(self.reference)) / np.std(self.reference)
|
|
86
|
+
# 计算互相关并归一化为相关系数
|
|
87
|
+
cross = sp.signal.fftconvolve(norm_trace, norm_ref[::-1], mode='valid')
|
|
88
|
+
|
|
89
|
+
newmaxloc = np.argmax(cross[self.ref_range[0]:self.ref_range[1]])
|
|
90
|
+
|
|
91
|
+
diff = newmaxloc-self._refmaxloc
|
|
92
|
+
if diff < 0:
|
|
93
|
+
newtrace = np.append(np.zeros(-diff), curr_trace[:diff])
|
|
94
|
+
elif diff > 0:
|
|
95
|
+
newtrace = np.append(curr_trace[diff:], np.zeros(diff))
|
|
96
|
+
traces[trace, :] = newtrace
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
if __name__ == "__main__":
|
|
100
|
+
# 示例用法
|
|
101
|
+
aligner = Staticalign(input_path='E:\\codes\\template\\dataset\\20250221202721.zarr')
|
|
102
|
+
aligner.auto_out_filename()
|
|
103
|
+
aligner.set_ref(ref_range=(100, 1000)) # 设置参考曲线范围
|
|
104
|
+
aligner.set_range(trace_range=(0, 100)) # 设置读取范围,可选
|
|
105
|
+
aligner.align_curves(method='correlation') # 使用相关性方法对齐曲线
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
import dask.array as da
|
|
2
|
+
import zarr
|
|
3
|
+
import os
|
|
4
|
+
|
|
5
|
+
class DaskZarrIO:
|
|
6
|
+
"""
|
|
7
|
+
用于高效读写Zarr文件的Dask封装类
|
|
8
|
+
"""
|
|
9
|
+
|
|
10
|
+
def __init__(self, input_path=None, output_path=None, expected_shape=None, chunks=None, tile='/0/0/'):
|
|
11
|
+
"""
|
|
12
|
+
初始化参数
|
|
13
|
+
:param input_path: 输入Zarr文件路径
|
|
14
|
+
:param output_path: 输出Zarr文件路径
|
|
15
|
+
:param expected_shape: 预期数组形状
|
|
16
|
+
:param chunks: 分块大小
|
|
17
|
+
"""
|
|
18
|
+
self.input_path = input_path
|
|
19
|
+
self.output_path = output_path
|
|
20
|
+
self.expected_shape = expected_shape
|
|
21
|
+
self.chunks = chunks
|
|
22
|
+
self.tile = tile
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
if not os.path.exists(self.input_path):
|
|
26
|
+
raise FileNotFoundError(f"输入文件不存在: {self.input_path}")
|
|
27
|
+
|
|
28
|
+
if not os.path.exists(self.input_path + tile + 'traces'):
|
|
29
|
+
raise FileNotFoundError(f"traces数据不存在: {self.input_path + tile + 'traces'}")
|
|
30
|
+
self.t = da.from_zarr(self.input_path + tile + 'traces')
|
|
31
|
+
self.num_samples = self.t.shape[1]
|
|
32
|
+
self.sel_num_samples = self.num_samples
|
|
33
|
+
self.num_traces = self.t.shape[0]
|
|
34
|
+
self.sel_num_traces = self.num_traces
|
|
35
|
+
self.trace_range = (0, self.num_traces)
|
|
36
|
+
self.sample_range = (0, self.num_samples)
|
|
37
|
+
if os.path.exists(self.input_path+tile+'plaintext'):
|
|
38
|
+
self.plaintext = da.from_zarr(self.input_path+tile+'plaintext')
|
|
39
|
+
else:
|
|
40
|
+
self.plaintext = None
|
|
41
|
+
if os.path.exists(self.input_path+tile+'key'):
|
|
42
|
+
self.key = da.from_zarr(self.input_path+tile+'key')
|
|
43
|
+
else:
|
|
44
|
+
self.key = None
|
|
45
|
+
if os.path.exists(self.input_path+tile+'ciphertext'):
|
|
46
|
+
self.metadata = da.from_zarr(self.input_path+tile+'ciphertext')
|
|
47
|
+
else:
|
|
48
|
+
self.metadata = None
|
|
49
|
+
|
|
50
|
+
def set_range(self, trace_range=None, sample_range=None):
|
|
51
|
+
"""
|
|
52
|
+
设置读取范围
|
|
53
|
+
:param trace_range: 读取的trace范围,默认为全范围
|
|
54
|
+
:param sample_range: 读取的sample范围,默认为全范围
|
|
55
|
+
"""
|
|
56
|
+
if trace_range is None:
|
|
57
|
+
self.trace_range = (0, self.num_traces)
|
|
58
|
+
else:
|
|
59
|
+
self.trace_range = trace_range
|
|
60
|
+
self.sel_num_traces = trace_range[1] - trace_range[0]
|
|
61
|
+
if sample_range is None:
|
|
62
|
+
self.sample_range = (0, self.num_samples)
|
|
63
|
+
else:
|
|
64
|
+
self.sample_range = sample_range
|
|
65
|
+
self.sel_num_samples = sample_range[1] - sample_range[0]
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
def read(self):
|
|
69
|
+
"""
|
|
70
|
+
读取Zarr文件为Dask数组
|
|
71
|
+
:return: Dask数组
|
|
72
|
+
"""
|
|
73
|
+
if not os.path.exists(self.input_path):
|
|
74
|
+
raise FileNotFoundError(f"输入文件不存在: {self.input_path}")
|
|
75
|
+
|
|
76
|
+
dask_array = da.from_zarr(self.input_path)
|
|
77
|
+
|
|
78
|
+
# if self.expected_shape and dask_array.shape != tuple(self.expected_shape):
|
|
79
|
+
# raise ValueError(f"数组形状不匹配,预期: {self.expected_shape}, 实际: {dask_array.shape}")
|
|
80
|
+
|
|
81
|
+
print(f"Dask数组形状: {dask_array.shape}")
|
|
82
|
+
print(f"Dask数组块大小: {dask_array.chunks}")
|
|
83
|
+
return dask_array
|
|
84
|
+
|
|
85
|
+
def write(self, dask_array):
|
|
86
|
+
"""
|
|
87
|
+
将Dask数组写入Zarr文件
|
|
88
|
+
:param dask_array: 要写入的Dask数组
|
|
89
|
+
"""
|
|
90
|
+
if not self.output_path:
|
|
91
|
+
raise ValueError("未指定输出路径")
|
|
92
|
+
|
|
93
|
+
if self.chunks:
|
|
94
|
+
dask_array = dask_array.rechunk(self.chunks)
|
|
95
|
+
|
|
96
|
+
dask_array.to_zarr(self.output_path, overwrite=True)
|
|
97
|
+
print(f"数据已写入: {self.output_path}")
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
# 保留原有函数作为兼容接口
|
|
102
|
+
def read_zarr_with_dask(zarr_path):
|
|
103
|
+
"""兼容旧版读取函数"""
|
|
104
|
+
return DaskZarrIO(input_path=zarr_path).read()
|
|
105
|
+
|
|
106
|
+
def write_dask_to_zarr(dask_array, output_path):
|
|
107
|
+
"""兼容旧版写入函数"""
|
|
108
|
+
DaskZarrIO(output_path=output_path).write(dask_array)
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
def merge_zarr_files(file1, file2, output_file, tile='/0/0/', axis=0):
|
|
113
|
+
"""
|
|
114
|
+
合并两个zarr文件并保存到输出文件
|
|
115
|
+
:param file1: 第一个zarr文件路径
|
|
116
|
+
:param file2: 第二个zarr文件路径
|
|
117
|
+
:param output_file: 输出文件路径
|
|
118
|
+
:param axis: 合并轴,0为垂直合并,1为水平合并
|
|
119
|
+
:return: 合并后的Dask数组
|
|
120
|
+
"""
|
|
121
|
+
|
|
122
|
+
store = zarr.DirectoryStore(output_file)
|
|
123
|
+
root = zarr.group(store=store, overwrite=True)
|
|
124
|
+
# 加载两个文件的曲线
|
|
125
|
+
arr1 = da.from_zarr(file1+tile+'traces')
|
|
126
|
+
arr2 = da.from_zarr(file2+tile+'traces')
|
|
127
|
+
# 检查形状是否兼容
|
|
128
|
+
if axis == 0 and arr1.shape[1:] != arr2.shape[1:]:
|
|
129
|
+
raise ValueError("垂直合并时除第一维外其他维度必须相同")
|
|
130
|
+
if axis == 1 and arr1.shape[0] != arr2.shape[0]:
|
|
131
|
+
raise ValueError("水平合并时第一维必须相同")
|
|
132
|
+
# 合并数组
|
|
133
|
+
merged = da.concatenate([arr1, arr2], axis=axis)
|
|
134
|
+
# 创建traces数据集
|
|
135
|
+
root.create_dataset(
|
|
136
|
+
'/0/0/traces',
|
|
137
|
+
shape=(merged.shape[0], merged.shape[1]),
|
|
138
|
+
data = merged.compute()
|
|
139
|
+
)
|
|
140
|
+
#TODO: 合并明文、密文和密钥
|
|
141
|
+
|
|
142
|
+
# 加载file1的traces数据集
|
|
143
|
+
file1_store = zarr.DirectoryStore(file1)
|
|
144
|
+
file1_root = zarr.group(store=file1_store)
|
|
145
|
+
|
|
146
|
+
# 将输出文件的attrs设为和file1一致
|
|
147
|
+
root.attrs.update(file1_root.attrs)
|
|
148
|
+
|
|
149
|
+
|
|
150
|
+
|
|
151
|
+
if __name__ == "__main__":
|
|
152
|
+
# 示例用法
|
|
153
|
+
input_path = "E:\\codes\\template\\dataset\\20250221202721.zarr"
|
|
154
|
+
output_path = "dataset/dask_output.zarr"
|
|
155
|
+
|
|
156
|
+
test = DaskZarrIO(input_path=input_path)
|
|
157
|
+
print(test.t[0].compute())
|
|
158
|
+
|
|
159
|
+
# 读取示例
|
|
160
|
+
# dask_data = read_zarr_with_dask(input_path)
|
|
161
|
+
|
|
162
|
+
# # 对数据进行一些操作(示例:计算均值)
|
|
163
|
+
# mean_value = dask_data.mean().compute()
|
|
164
|
+
# print(f"数据均值: {mean_value}")
|
|
165
|
+
|
|
166
|
+
# 写入示例
|
|
167
|
+
# write_dask_to_zarr(dask_data, output_path)
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: cracknuts-squirrel
|
|
3
|
+
Version: 0.1.0a1
|
|
4
|
+
Summary: A Python library for side-channel analysis
|
|
5
|
+
Author-email: Dingzb <dingzibiao@gmail.com>
|
|
6
|
+
Maintainer-email: Dingzb <dingzibiao@gmail.com>
|
|
7
|
+
License-Expression: Apache-2.0
|
|
8
|
+
Project-URL: homepage, https://cracknuts.io
|
|
9
|
+
Requires-Python: >=3.12
|
|
10
|
+
Description-Content-Type: text/markdown
|
|
11
|
+
License-File: LICENSE
|
|
12
|
+
Requires-Dist: numpy~=1.26.4
|
|
13
|
+
Requires-Dist: pycryptodome~=3.23.0
|
|
14
|
+
Requires-Dist: zarr~=2.18.2
|
|
15
|
+
Requires-Dist: packaging~=24.1
|
|
16
|
+
Requires-Dist: numba~=0.61.2
|
|
17
|
+
Requires-Dist: dask~=2025.5.1
|
|
18
|
+
Provides-Extra: jupyter
|
|
19
|
+
Requires-Dist: jupyter~=1.1.1; extra == "jupyter"
|
|
20
|
+
Dynamic: license-file
|
|
21
|
+
|
|
22
|
+
# CrackNuts Squirrel
|
|
23
|
+
|
|
24
|
+
## For Developers
|
|
25
|
+
|
|
26
|
+
In the virtual environment, run the following command to install the dependencies:
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
pip install -e .
|
|
30
|
+
pip install -r requirements-dev.txt
|
|
31
|
+
```
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
LICENSE
|
|
2
|
+
README.md
|
|
3
|
+
pyproject.toml
|
|
4
|
+
src/cracknuts_squirrel/__init__.py
|
|
5
|
+
src/cracknuts_squirrel/cpa_analysis.py
|
|
6
|
+
src/cracknuts_squirrel/preprocessingBasic.py
|
|
7
|
+
src/cracknuts_squirrel/staticalgin.py
|
|
8
|
+
src/cracknuts_squirrel/traceIO.py
|
|
9
|
+
src/cracknuts_squirrel.egg-info/PKG-INFO
|
|
10
|
+
src/cracknuts_squirrel.egg-info/SOURCES.txt
|
|
11
|
+
src/cracknuts_squirrel.egg-info/dependency_links.txt
|
|
12
|
+
src/cracknuts_squirrel.egg-info/requires.txt
|
|
13
|
+
src/cracknuts_squirrel.egg-info/top_level.txt
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
cracknuts_squirrel
|