Commit d240d74
authored
Increase salt bytes to 32 from 16 + use platform secure random generator for salt generation (#18)
* Increase salt size from 16 to 32 bytes
* Improve salt generation with cryptographically secure random using Security framework
* Simplify secure random implementation using direct array reference
* Add clean tests for secure random generation
* Fix salt tests to be more realistic about random distribution
* Remove overly complex salt generation test
* Fix: Use MemoryLayout.size instead of stride for accurate byte count
* use SystemRandomNumberGenerator for generating random UInt8
* move random(count:) to other extension1 parent 9392d9d commit d240d74
3 files changed
Lines changed: 39 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
2 | 1 | | |
3 | | - | |
4 | | - | |
5 | | - | |
6 | | - | |
7 | | - | |
8 | | - | |
9 | | - | |
10 | | - | |
11 | | - | |
12 | 2 | | |
13 | 3 | | |
14 | 4 | | |
15 | 5 | | |
16 | 6 | | |
17 | 7 | | |
18 | 8 | | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
19 | 22 | | |
20 | 23 | | |
21 | 24 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
165 | 165 | | |
166 | 166 | | |
167 | 167 | | |
168 | | - | |
| 168 | + | |
169 | 169 | | |
170 | 170 | | |
171 | 171 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
7 | 30 | | |
8 | 31 | | |
9 | 32 | | |
| |||
267 | 290 | | |
268 | 291 | | |
269 | 292 | | |
270 | | - | |
| 293 | + | |
| 294 | + | |
271 | 295 | | |
272 | 296 | | |
273 | 297 | | |
| |||
0 commit comments