generate ECC keys instead of Ed25519 keys

This commit is contained in:
2025-10-24 01:02:31 +02:00
parent 6620aa898d
commit 6c7a0b7461
2 changed files with 20 additions and 19 deletions
+17 -17
View File
@@ -51,24 +51,24 @@ Also see <https://en.wikipedia.org/wiki/Hexspeak> for some further examples of "
### How long does it take? ### How long does it take?
On my machine with an AMD Ryzen 7 5800X processor, Fingerprunk is able to generate and check about On my machine with an AMD Ryzen 7 5800X processor, Fingerprunk is able to generate and check about
43300 keys per second. This means that for finding a fingerprint with a string of *n* specific 41000 keys per second. This means that for finding a fingerprint with a string of *n* specific
hexadecimal digits at a specific place, I could expect the following runtimes until finding the hexadecimal digits at a specific place, I could expect the following runtimes until finding the
first key: first key:
| *n* | expected tries | expected time | | *n* | estimate tries | estimate time |
| --: | --------------: | ------------: | | --: | ---------------------: | ------------: |
| *n* | 16ⁿ | 43300s / 16ⁿ | | 1 | 16 = 16¹ | < 0.1 secs |
| 2 | 256 | 0.0059 secs | | 2 | 256 = 16² | < 0.1 secs |
| 3 | 4096 | 0.0946 secs | | 3 | 4096 = 16³ | 0.1 secs |
| 4 | 65536 | 1.5 secs | | 4 | 65536 = 16⁴ | 1.6 secs |
| 5 | 1028576 | 24 secs | | 5 | 1048576 = 16⁵ | 26 secs |
| 6 | 16777216 | 6.5 mins | | 6 | 16777216 = 16⁶ | 7 mins |
| 7 | 268435456 | 103 mins | | 7 | 268435456 = 16⁷ | 2 hours |
| 8 | 4294967296 | 27 hours | | 8 | 4294967296 = 16⁸ | 1 days |
| 9 | 68719476736 | 18 days | | 9 | 68719476736 = 16⁹ | 19 days |
| 10 | 1099511627776 | 293 days | | 10 | 1099511627776 = 16¹⁰ | 310 days |
| 11 | 17592186044416 | 13 years | | 11 | 17592186044416 = 16¹¹ | 14 years |
| 12 | 281474976710656 | 206 years | | 12 | 281474976710656 = 16¹² | 218 years |
As you can see, anything above 8 or 9 fixed digits is pretty much unfeasible, at least with As you can see, anything above 10 fixed digits is pretty much unfeasible, at least with a normal
a normal personal computer. personal computer.
+3 -2
View File
@@ -22,7 +22,7 @@ use sequoia_openpgp::{
prelude::SignatureBuilder, prelude::SignatureBuilder,
}, },
serialize::Serialize, serialize::Serialize,
types::{HashAlgorithm, SignatureType, SymmetricAlgorithm}, types::{Curve, HashAlgorithm, SignatureType, SymmetricAlgorithm},
}; };
type SecretKey = Key<SecretParts, PrimaryRole>; type SecretKey = Key<SecretParts, PrimaryRole>;
@@ -92,7 +92,8 @@ impl Fingerprunk {
let mut fingerprint_hex = String::with_capacity(20 * 2); let mut fingerprint_hex = String::with_capacity(20 * 2);
loop { loop {
let key = Key4::generate_ed25519().expect("should be able to generate key"); let key =
Key4::generate_ecc(true, Curve::Ed25519).expect("should be able to generate key");
fingerprint_hex.clear(); fingerprint_hex.clear();
write!(fingerprint_hex, "{:X}", key.fingerprint()) write!(fingerprint_hex, "{:X}", key.fingerprint())
.expect("should write into string without error"); .expect("should write into string without error");