Test
# java version "1.7.0_51"
# Java(TM) SE Runtime Environment (build 1.7.0_51-b13)
# Java HotSpot(TM) 64-Bit Server VM (build 24.51-b03, mixed mode)
# CBC: AES/CBC/PKCS5Padding; SunJCE
# BC.CBC: AES/CBC/PKCS5Padding; BC (Bouncy Castle v1.5)
# GCM: AES/GCM/NoPadding; BC (Bouncy Castle v1.5)
# CTR: AES/CTR/NoPadding; SunJCE
# BC.CTR: AES/CTR/NoPadding; BC (Bouncy Castle v1.5)
# key length: 256 bits
# (CBC/CTR) IV length: 128 bits
# (GCM) tag length: 128 bits
# (GCM) IV length: 96 bits
# plaintext size: ~5M bytes
# number of encrypt/decrypt per Cipher: 160
# time unit: milliseconds
Statistics
vars n mean sd median trimmed mad min max range skew kurtosis se
CBC 1 160 62.65 29.32 59.0 59.42 5.93 51 419 368 11.25 133.50 2.32
BC.CBC 2 160 170.31 69.71 162.0 163.75 10.38 145 1031 886 11.76 142.23 5.51
GCM 3 160 324.79 74.30 316.5 316.79 12.60 297 1233 936 11.44 136.54 5.87
CTR 4 160 67.68 26.47 64.0 65.05 5.93 57 391 334 11.39 136.10 2.09
BC.CTR 5 160 166.16 68.23 158.0 160.00 13.34 139 1009 870 11.78 142.57 5.39
CBC BC.CBC GCM CTR BC.CTR
Min. : 51.00 Min. : 145.0 Min. : 297.0 Min. : 57.00 Min. : 139.0
1st Qu.: 55.00 1st Qu.: 156.0 1st Qu.: 308.8 1st Qu.: 60.00 1st Qu.: 151.0
Median : 59.00 Median : 162.0 Median : 316.5 Median : 64.00 Median : 158.0
Mean : 62.65 Mean : 170.3 Mean : 324.8 Mean : 67.68 Mean : 166.2
3rd Qu.: 63.00 3rd Qu.: 171.0 3rd Qu.: 325.0 3rd Qu.: 70.00 3rd Qu.: 169.2
Max. :419.00 Max. :1031.0 Max. :1233.0 Max. :391.00 Max. :1009.0
R
all <- read.table("/tmp/cipher_compare.log", header=T)
library(psych)
describe(all)
summary(all)
plot(density(all$CBC),col="black",main="Cipher latency density plots",xlab="Latency (ms)",ylab="Frequency density")
lines(density(all$BC.CBC),col="red")
lines(density(all$CTR),col="blue")
lines(density(all$BC.CTR),col="orange")
lines(density(all$GCM),col="green")
legend("topright", legend=c(
"AES/CBC/PKCS5Padding; SunJCE 1.7.0_51",
"AES/CBC/PKCS5Padding; BC 1.5",
"AES/CTR/NoPadding; SunJCE 1.7.0_51",
"AES/CTR/NoPadding; BC 1.5",
"AES/GCM/NoPadding; BC 1.5"),
text.col=c("black","red","blue","orange","green”))
Discussion at
Bouncy Castle devo forum.
# posted by rot13(Unafba Pune) @ 1:53 PM