Initial commit

This commit is contained in:
2019-05-14 13:27:11 +02:00
commit 75fb7278c9
11 changed files with 460 additions and 0 deletions

20
break_script/break_aes.jl Executable file
View File

@@ -0,0 +1,20 @@
#!/usr/bin/env julia
include("util.jl")
include("sbox.jl")
include("plotutils.jl")
function break_aes()
plaintexts = load_file("plaintexts.dat", UInt8)[1:10_000, :]
timings = load_file("timings.dat", UInt32)[1:10_000]
t_values = Vector{Float64}(undef, 0x100)
for key=0:0xFF
msb_set = (sbox[(plaintexts[:, 1] .⊻ key) .+ 1] .& 0x80) .!= 0
group_slow = timings[msb_set]
group_fast = timings[msb_set.==false]
t_values[key + 1] = t_val(group_fast, group_slow)
end
plot_discrete_tval(0:0xFF, t_values, "key")
end
@time break_aes()