-
Notifications
You must be signed in to change notification settings - Fork 0
295 lines (292 loc) · 12.9 KB
/
dexios-tests.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
name: Dexios Tests
on:
workflow_dispatch:
branches: [ master ]
pull_request:
branches: [ master ]
env:
CARGO_TERM_COLOR: always
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
- name: Restore cargo cache
uses: actions/[email protected]
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-stable-${{ hashFiles('Cargo.lock') }}
- name: Build
uses: actions-rs/cargo@v1
with:
command: build
args: --release
- name: Strip
run: strip target/release/dexios
- name: Upload Binary as artifact
uses: actions/upload-artifact@v3
with:
name: dexios
path: target/release/dexios
retention-days: 1
stream-mode:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Retrieve Dexios
uses: actions/download-artifact@v3
with:
name: dexios
path: target/release/dexios
- name: Make Binary Executable
run: chmod +x /home/runner/work/dexios/dexios/target/release/dexios/dexios
- name: Generate test file
run: dd if=/dev/urandom of=100MB.bin bs=1M count=100
- name: Generate keyfile
run: dd if=/dev/urandom of=keyfile bs=1 count=4096
- name: Encrypt in stream mode (XChaCha20-Poly1305)
run: /home/runner/work/dexios/dexios/target/release/dexios/dexios -eHfk keyfile 100MB.bin 100MB.enc
- name: Decrypt in stream mode (XChaCha20-Poly1305)
run: /home/runner/work/dexios/dexios/target/release/dexios/dexios -dHfk keyfile 100MB.enc 100MB.bin
- name: Generate test file
run: dd if=/dev/urandom of=100MB.bin bs=1M count=100
- name: Encrypt in stream mode (AES-256-GCM)
run: /home/runner/work/dexios/dexios/target/release/dexios/dexios -eHfk keyfile --aes 100MB.bin 100MB.enc
- name: Decrypt in stream mode (AES-256-GCM)
run: /home/runner/work/dexios/dexios/target/release/dexios/dexios -dHfk keyfile 100MB.enc 100MB.bin
header-tests:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Retrieve Dexios
uses: actions/download-artifact@v3
with:
name: dexios
path: target/release/dexios
- name: Make Binary Executable
run: chmod +x /home/runner/work/dexios/dexios/target/release/dexios/dexios
- name: Generate test file
run: dd if=/dev/urandom of=100MB.bin bs=1M count=100
- name: Generate keyfile
run: dd if=/dev/urandom of=keyfile bs=1 count=4096
- name: Encrypt in stream mode (XChaCha20-Poly1305)
run: /home/runner/work/dexios/dexios/target/release/dexios/dexios -eHfk keyfile 100MB.bin 100MB.enc
- name: Dump Header
run: /home/runner/work/dexios/dexios/target/release/dexios/dexios header dump 100MB.enc 100MB.enc.header
- name: Strip Header
run: /home/runner/work/dexios/dexios/target/release/dexios/dexios header strip 100MB.enc
- name: Restore Header
run: /home/runner/work/dexios/dexios/target/release/dexios/dexios header restore 100MB.enc.header 100MB.enc
- name: Decrypt in stream mode (XChaCha20-Poly1305)
run: /home/runner/work/dexios/dexios/target/release/dexios/dexios -dHfk keyfile 100MB.enc 100MB.bin
- name: Strip Header
run: /home/runner/work/dexios/dexios/target/release/dexios/dexios header strip 100MB.enc
- name: Decrypt in stream mode with detached header (XChaCha20-Poly1305)
run: /home/runner/work/dexios/dexios/target/release/dexios/dexios -dHfk keyfile --header 100MB.enc.header 100MB.enc 100MB.bin
- name: Encrypt in stream mode to detached header (XChaCha20-Poly1305)
run: /home/runner/work/dexios/dexios/target/release/dexios/dexios -eHfk keyfile --header 100MB.header 100MB.bin 100MB.enc
- name: Decrypt in stream mode with detached header (XChaCha20-Poly1305)
run: /home/runner/work/dexios/dexios/target/release/dexios/dexios -dHfk keyfile --header 100MB.header 100MB.enc 100MB.bin
hash-standalone-mode:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Retrieve Dexios
uses: actions/download-artifact@v3
with:
name: dexios
path: target/release/dexios
- name: Make Binary Executable
run: chmod +x /home/runner/work/dexios/dexios/target/release/dexios/dexios
- name: Generate test file
run: dd if=/dev/urandom of=100MB.bin bs=1M count=100
- name: Generate keyfile
run: dd if=/dev/urandom of=keyfile bs=1 count=4096
- name: Encrypt in stream mode (XChaCha20-Poly1305)
run: /home/runner/work/dexios/dexios/target/release/dexios/dexios -eHfk keyfile 100MB.bin 100MB.enc
- name: Decrypt in stream mode (XChaCha20-Poly1305)
run: /home/runner/work/dexios/dexios/target/release/dexios/dexios -dHfk keyfile 100MB.enc 100MB.bin
- name: Standalone Hash Mode (with output hashes above to confirm it works)
run: /home/runner/work/dexios/dexios/target/release/dexios/dexios hash 100MB.enc
erase:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Retrieve Dexios
uses: actions/download-artifact@v3
with:
name: dexios
path: target/release/dexios
- name: Make Binary Executable
run: chmod +x /home/runner/work/dexios/dexios/target/release/dexios/dexios
- name: Generate test file
run: dd if=/dev/urandom of=100MB.bin bs=1M count=100
- name: Erase file (standalone mode)
run: /home/runner/work/dexios/dexios/target/release/dexios/dexios erase 100MB.bin
large-file:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Retrieve Dexios
uses: actions/download-artifact@v3
with:
name: dexios
path: target/release/dexios
- name: Make Binary Executable
run: chmod +x /home/runner/work/dexios/dexios/target/release/dexios/dexios
- name: Generate test file
run: dd if=/dev/urandom of=1GB.bin bs=1M count=1000
- name: Generate keyfile
run: dd if=/dev/urandom of=keyfile bs=1 count=4096
- name: Encrypt 1GB file (XChaCha20-Poly1305)
run: /home/runner/work/dexios/dexios/target/release/dexios/dexios -eHfk keyfile 1GB.bin 1GB.enc
- name: Decrypt 1GB file (XChaCha20-Poly1305)
run: /home/runner/work/dexios/dexios/target/release/dexios/dexios -dHfk keyfile 1GB.enc 1GB.bin
- name: Generate test file
run: dd if=/dev/urandom of=1GB.bin bs=1M count=1000
- name: Encrypt 1GB file (AES-256-GCM)
run: /home/runner/work/dexios/dexios/target/release/dexios/dexios -eHfk keyfile --aes 1GB.bin 1GB.enc
- name: Decrypt 1GB file (AES-256-GCM)
run: /home/runner/work/dexios/dexios/target/release/dexios/dexios -dHfk keyfile 1GB.enc 1GB.bin
small-file:
needs: build
runs-on: ubuntu-latest
steps:
- name: Retrieve Dexios
uses: actions/download-artifact@v3
with:
name: dexios
path: target/release/dexios
- name: Make Binary Executable
run: chmod +x /home/runner/work/dexios/dexios/target/release/dexios/dexios
- name: Generate test file
run: dd if=/dev/urandom of=1KB.bin bs=1 count=1024
- name: Generate keyfile
run: dd if=/dev/urandom of=keyfile bs=1 count=4096
- name: Encrypt 1KB file (XChaCha20-Poly1305)
run: /home/runner/work/dexios/dexios/target/release/dexios/dexios -eHfk keyfile 1KB.bin 1KB.enc
- name: Decrypt 1KB file (XChaCha20-Poly1305)
run: /home/runner/work/dexios/dexios/target/release/dexios/dexios -dHfk keyfile 1KB.enc 1KB.bin
- name: Generate test file
run: dd if=/dev/urandom of=1KB.bin bs=1 count=1024
- name: Encrypt 1KB file (AES-256-GCM)
run: /home/runner/work/dexios/dexios/target/release/dexios/dexios -eHfk keyfile --aes 1KB.bin 1KB.enc
- name: Decrypt 1KB file (AES-256-GCM)
run: /home/runner/work/dexios/dexios/target/release/dexios/dexios -dHfk keyfile 1KB.enc 1KB.bin
pack:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Retrieve Dexios
uses: actions/download-artifact@v3
with:
name: dexios
path: target/release/dexios
- name: Make Binary Executable
run: chmod +x /home/runner/work/dexios/dexios/target/release/dexios/dexios
- name: Make Directory
run: mkdir test
- name: Generate test files
run: dd if=/dev/urandom of=test/1.bin bs=1M count=10 && dd if=/dev/urandom of=test/2.bin bs=1M count=10 && dd if=/dev/urandom of=test/3.bin bs=1M count=10 && dd if=/dev/urandom of=test/4.bin bs=1M count=10
- name: Generate keyfile
run: dd if=/dev/urandom of=keyfile bs=1 count=4096
- name: Pack+Encrypt test directory (XChaCha20-Poly1305)
run: /home/runner/work/dexios/dexios/target/release/dexios/dexios pack -fk keyfile test/ output.zip
- name: Remove Directory
run: rm -rf test/
- name: Decrypt+Unpack archive (XChaCha20-Poly1305)
run: /home/runner/work/dexios/dexios/target/release/dexios/dexios unpack -fk keyfile output.zip .
- name: List files in directory
run: ls -lla test/
key-add:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Retrieve Dexios
uses: actions/download-artifact@v3
with:
name: dexios
path: target/release/dexios
- name: Make Binary Executable
run: chmod +x /home/runner/work/dexios/dexios/target/release/dexios/dexios
- name: Generate test file
run: dd if=/dev/urandom of=100MB.bin bs=1M count=100
- name: Generate keyfile
run: dd if=/dev/urandom of=keyfile bs=1 count=4096
- name: Generate keyfile for test
run: dd if=/dev/urandom of=keyfile-new bs=1 count=4096
- name: Encrypt in stream mode (XChaCha20-Poly1305)
run: /home/runner/work/dexios/dexios/target/release/dexios/dexios -eHfk keyfile 100MB.bin 100MB.enc
- name: Add new key (from new keyfile)
run: /home/runner/work/dexios/dexios/target/release/dexios/dexios key add -k keyfile -n keyfile-new 100MB.enc
- name: Decrypt in stream mode with added key (XChaCha20-Poly1305)
run: /home/runner/work/dexios/dexios/target/release/dexios/dexios -dHfk keyfile-new 100MB.enc 100MB.bin
- name: Show header details
run: /home/runner/work/dexios/dexios/target/release/dexios/dexios header details 100MB.enc
key-del:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Retrieve Dexios
uses: actions/download-artifact@v3
with:
name: dexios
path: target/release/dexios
- name: Make Binary Executable
run: chmod +x /home/runner/work/dexios/dexios/target/release/dexios/dexios
- name: Generate test file
run: dd if=/dev/urandom of=100MB.bin bs=1M count=100
- name: Generate keyfile
run: dd if=/dev/urandom of=keyfile bs=1 count=4096
- name: Generate keyfile for test
run: dd if=/dev/urandom of=keyfile-new bs=1 count=4096
- name: Encrypt in stream mode (XChaCha20-Poly1305)
run: /home/runner/work/dexios/dexios/target/release/dexios/dexios -eHfk keyfile 100MB.bin 100MB.enc
- name: Add new key (from new keyfile)
run: /home/runner/work/dexios/dexios/target/release/dexios/dexios key add -k keyfile -n keyfile-new 100MB.enc
- name: Delete the original key
run: /home/runner/work/dexios/dexios/target/release/dexios/dexios key del -k keyfile 100MB.enc
- name: Decrypt in stream mode with added key (XChaCha20-Poly1305)
run: /home/runner/work/dexios/dexios/target/release/dexios/dexios -dHfk keyfile-new 100MB.enc 100MB.bin
- name: Show header details
run: /home/runner/work/dexios/dexios/target/release/dexios/dexios header details 100MB.enc
key-change:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Retrieve Dexios
uses: actions/download-artifact@v3
with:
name: dexios
path: target/release/dexios
- name: Make Binary Executable
run: chmod +x /home/runner/work/dexios/dexios/target/release/dexios/dexios
- name: Generate test file
run: dd if=/dev/urandom of=100MB.bin bs=1M count=100
- name: Generate keyfile
run: dd if=/dev/urandom of=keyfile bs=1 count=4096
- name: Generate keyfile for test
run: dd if=/dev/urandom of=keyfile-new bs=1 count=4096
- name: Encrypt in stream mode (XChaCha20-Poly1305)
run: /home/runner/work/dexios/dexios/target/release/dexios/dexios -eHfk keyfile 100MB.bin 100MB.enc
- name: Change the key (from new keyfile)
run: /home/runner/work/dexios/dexios/target/release/dexios/dexios key change -k keyfile -n keyfile-new 100MB.enc
- name: Decrypt in stream mode with changed key (XChaCha20-Poly1305)
run: /home/runner/work/dexios/dexios/target/release/dexios/dexios -dHfk keyfile-new 100MB.enc 100MB.bin
- name: Show header details
run: /home/runner/work/dexios/dexios/target/release/dexios/dexios header details 100MB.enc