fixes, save results, visualizations
This commit is contained in:
parent
c461f189b6
commit
0611f1c786
21 changed files with 121 additions and 10 deletions
5
3des192_decryption.csv
Normal file
5
3des192_decryption.csv
Normal file
|
@ -0,0 +1,5 @@
|
|||
key_size,data_size,time_ms
|
||||
192,10,0.001
|
||||
192,1000,0.062
|
||||
192,100000,6.207
|
||||
192,10000000,621.734
|
|
5
3des192_encryption.csv
Normal file
5
3des192_encryption.csv
Normal file
|
@ -0,0 +1,5 @@
|
|||
key_size,data_size,time_ms
|
||||
192,10,0.002
|
||||
192,1000,0.067
|
||||
192,100000,6.249
|
||||
192,10000000,627.943
|
|
5
3des_keygen_benchmark.csv
Normal file
5
3des_keygen_benchmark.csv
Normal file
|
@ -0,0 +1,5 @@
|
|||
count,key_size,time_ms
|
||||
1,192,0.001
|
||||
10,192,0.06
|
||||
100,192,0.062
|
||||
1000,192,0.103
|
|
5
aes128_decryption.csv
Normal file
5
aes128_decryption.csv
Normal file
|
@ -0,0 +1,5 @@
|
|||
key_size,data_size,time_ms
|
||||
128,10,0
|
||||
128,1000,0
|
||||
128,100000,0.008
|
||||
128,10000000,4.272
|
|
5
aes128_encryption.csv
Normal file
5
aes128_encryption.csv
Normal file
|
@ -0,0 +1,5 @@
|
|||
key_size,data_size,time_ms
|
||||
128,10,0
|
||||
128,1000,0
|
||||
128,100000,0.068
|
||||
128,10000000,11.043
|
|
5
aes192_decryption.csv
Normal file
5
aes192_decryption.csv
Normal file
|
@ -0,0 +1,5 @@
|
|||
key_size,data_size,time_ms
|
||||
192,10,0
|
||||
192,1000,0
|
||||
192,100000,0.012
|
||||
192,10000000,3.884
|
|
5
aes192_encryption.csv
Normal file
5
aes192_encryption.csv
Normal file
|
@ -0,0 +1,5 @@
|
|||
key_size,data_size,time_ms
|
||||
192,10,0
|
||||
192,1000,0.001
|
||||
192,100000,0.082
|
||||
192,10000000,11.771
|
|
5
aes256_decryption.csv
Normal file
5
aes256_decryption.csv
Normal file
|
@ -0,0 +1,5 @@
|
|||
key_size,data_size,time_ms
|
||||
256,10,0
|
||||
256,1000,0
|
||||
256,100000,0.014
|
||||
256,10000000,4.184
|
|
5
aes256_encryption.csv
Normal file
5
aes256_encryption.csv
Normal file
|
@ -0,0 +1,5 @@
|
|||
key_size,data_size,time_ms
|
||||
256,10,0.001
|
||||
256,1000,0.001
|
||||
256,100000,0.091
|
||||
256,10000000,11.563
|
|
13
aes_keygen_benchmark.csv
Normal file
13
aes_keygen_benchmark.csv
Normal file
|
@ -0,0 +1,13 @@
|
|||
count,key_size,time_ms
|
||||
1,128,0
|
||||
1,192,0
|
||||
1,256,0
|
||||
10,128,0.04
|
||||
10,192,0.061
|
||||
10,256,0.08
|
||||
100,128,0.042
|
||||
100,192,0.06
|
||||
100,256,0.08
|
||||
1000,128,0.069
|
||||
1000,192,0.101
|
||||
1000,256,0.134
|
|
5
rsa1024_decryption.csv
Normal file
5
rsa1024_decryption.csv
Normal file
|
@ -0,0 +1,5 @@
|
|||
key_size,data_size,time_ms
|
||||
1024,10,0.233
|
||||
1024,1000,1.974
|
||||
1024,100000,189.815
|
||||
1024,10000000,18984.256
|
|
5
rsa1024_encryption.csv
Normal file
5
rsa1024_encryption.csv
Normal file
|
@ -0,0 +1,5 @@
|
|||
key_size,data_size,time_ms
|
||||
1024,10,0.051
|
||||
1024,1000,0.403
|
||||
1024,100000,37.897
|
||||
1024,10000000,3776.197
|
|
5
rsa2048_decryption.csv
Normal file
5
rsa2048_decryption.csv
Normal file
|
@ -0,0 +1,5 @@
|
|||
key_size,data_size,time_ms
|
||||
2048,10,1.307
|
||||
2048,1000,6.474
|
||||
2048,100000,529.126
|
||||
2048,10000000,52808.375
|
|
5
rsa2048_encryption.csv
Normal file
5
rsa2048_encryption.csv
Normal file
|
@ -0,0 +1,5 @@
|
|||
key_size,data_size,time_ms
|
||||
2048,10,0.165
|
||||
2048,1000,0.784
|
||||
2048,100000,63.955
|
||||
2048,10000000,6372.035
|
|
5
rsa3072_decryption.csv
Normal file
5
rsa3072_decryption.csv
Normal file
|
@ -0,0 +1,5 @@
|
|||
key_size,data_size,time_ms
|
||||
3072,10,3.928
|
||||
3072,1000,11.809
|
||||
3072,100000,1054.251
|
||||
3072,10000000,105256.87
|
|
5
rsa3072_encryption.csv
Normal file
5
rsa3072_encryption.csv
Normal file
|
@ -0,0 +1,5 @@
|
|||
key_size,data_size,time_ms
|
||||
3072,10,0.351
|
||||
3072,1000,1.018
|
||||
3072,100000,90.893
|
||||
3072,10000000,9050.934
|
|
5
rsa512_decryption.csv
Normal file
5
rsa512_decryption.csv
Normal file
|
@ -0,0 +1,5 @@
|
|||
key_size,data_size,time_ms
|
||||
512,10,0.059
|
||||
512,1000,0.966
|
||||
512,100000,96.361
|
||||
512,10000000,9568.021
|
|
5
rsa512_encryption.csv
Normal file
5
rsa512_encryption.csv
Normal file
|
@ -0,0 +1,5 @@
|
|||
key_size,data_size,time_ms
|
||||
512,10,0.018
|
||||
512,1000,0.287
|
||||
512,100000,27.48
|
||||
512,10000000,2790.804
|
|
13
rsa_keygen_benchmark.csv
Normal file
13
rsa_keygen_benchmark.csv
Normal file
|
@ -0,0 +1,13 @@
|
|||
count,key_size,time_ms
|
||||
1,512,4.11
|
||||
1,1024,22.783
|
||||
1,2048,128.464
|
||||
10,512,26.444
|
||||
10,1024,153.001
|
||||
10,2048,1658.256
|
||||
100,512,241.216
|
||||
100,1024,1492.256
|
||||
100,2048,15214.671
|
||||
1000,512,2526.931
|
||||
1000,1024,15952.701
|
||||
1000,2048,148078.44
|
|
20
src/main.rs
20
src/main.rs
|
@ -181,7 +181,7 @@ fn measure_aes_performance(
|
|||
iv: &[u8],
|
||||
sizes: &[usize]
|
||||
) -> Result<(), Box<dyn Error>> {
|
||||
println!("Measuting aes{} performance", key.len().to_string());
|
||||
println!("Measuting aes{} performance", (key.len()*8).to_string());
|
||||
let mut encryption_results = vec![];
|
||||
let mut decryption_results = vec![];
|
||||
|
||||
|
@ -210,7 +210,7 @@ fn measure_aes_performance(
|
|||
let mut wtr = csv::Writer::from_writer(encrypt_file);
|
||||
wtr.write_record(&["key_size", "data_size", "time_ms"])?;
|
||||
for (size, time) in encryption_results {
|
||||
wtr.write_record(&[key.len().to_string(), size.to_string(), time.to_string()])?;
|
||||
wtr.write_record(&[(key.len()*8).to_string(), size.to_string(), time.to_string()])?;
|
||||
}
|
||||
|
||||
// Save decryption results to CSV
|
||||
|
@ -218,7 +218,7 @@ fn measure_aes_performance(
|
|||
let mut wtr = csv::Writer::from_writer(decrypt_file);
|
||||
wtr.write_record(&["key_size", "data_size", "time_ms"])?;
|
||||
for (size, time) in decryption_results {
|
||||
wtr.write_record(&[key.len().to_string(), size.to_string(), time.to_string()])?;
|
||||
wtr.write_record(&[(key.len()*8).to_string(), size.to_string(), time.to_string()])?;
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
@ -259,7 +259,7 @@ fn measure_3des_performance(
|
|||
let mut wtr = csv::Writer::from_writer(encrypt_file);
|
||||
wtr.write_record(&["key_size", "data_size", "time_ms"])?;
|
||||
for (size, time) in encryption_results {
|
||||
wtr.write_record(&[key.len().to_string(), size.to_string(), time.to_string()])?;
|
||||
wtr.write_record(&[(key.len()*8).to_string(), size.to_string(), time.to_string()])?;
|
||||
}
|
||||
|
||||
// Save decryption results to CSV
|
||||
|
@ -267,15 +267,15 @@ fn measure_3des_performance(
|
|||
let mut wtr = csv::Writer::from_writer(decrypt_file);
|
||||
wtr.write_record(&["key_size", "data_size", "time_ms"])?;
|
||||
for (size, time) in decryption_results {
|
||||
wtr.write_record(&[key.len().to_string(), size.to_string(), time.to_string()])?;
|
||||
wtr.write_record(&[(key.len()*8).to_string(), size.to_string(), time.to_string()])?;
|
||||
}
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
fn test_rsa_key_gen(rng: OsRng) -> Result<(), Box<dyn Error>> {
|
||||
let counts = [1, 10, 100 ];
|
||||
let key_sizes = [1024, 2048 ];
|
||||
let counts = [1, 10, 100, 1000 ];
|
||||
let key_sizes = [512, 1024, 2048 ];
|
||||
|
||||
let file = File::create("rsa_keygen_benchmark.csv")?;
|
||||
let mut wtr = csv::Writer::from_writer(file);
|
||||
|
@ -304,7 +304,7 @@ fn test_rsa_key_gen(rng: OsRng) -> Result<(), Box<dyn Error>> {
|
|||
|
||||
fn test_3des_key_gen(rng: OsRng) -> Result<(), Box<dyn Error>> {
|
||||
let counts = [1, 10, 100, 1000 ];
|
||||
let key_sizes = [112, 168 ];
|
||||
let key_sizes = [192 ];
|
||||
|
||||
let file = File::create("3des_keygen_benchmark.csv")?;
|
||||
let mut wtr = csv::Writer::from_writer(file);
|
||||
|
@ -367,7 +367,7 @@ fn main() {
|
|||
let _result = test_aes_key_gen(rng);
|
||||
|
||||
let iv = [0x8; 16];
|
||||
let data_sizes = [10, 1000, 10000, 100000 ];
|
||||
let data_sizes = [10, 1000, 100000, 10000000 ];
|
||||
|
||||
let _result = measure_aes_performance(&generate_aes_keys(128, 1, rng)[0], &iv, &data_sizes);
|
||||
let _result = measure_aes_performance(&generate_aes_keys(192, 1, rng)[0], &iv, &data_sizes);
|
||||
|
@ -376,7 +376,7 @@ fn main() {
|
|||
let iv = [0x8; 8];
|
||||
let _result = measure_3des_performance(&generate_3des_keys(192, 1, rng)[0], &iv, &data_sizes);
|
||||
|
||||
for size in [512, 1024, 2048] {
|
||||
for size in [512, 1024, 2048, 3072] {
|
||||
let keys = generate_rsa_keys(1, size, rng);
|
||||
let (privkey, pubkey) = &keys[0];
|
||||
match measure_rsa_performance(&privkey, &pubkey, size, &data_sizes) {
|
||||
|
|
BIN
visualize.ods
Normal file
BIN
visualize.ods
Normal file
Binary file not shown.
Loading…
Reference in a new issue