Git Product home page Git Product logo

jlsca's People

Contributors

ceesb avatar ikizhvatov avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

jlsca's Issues

@everywhere not defined

After updating Julia to v.1.0.0 and using the newest Jlsca this happens:

_.julia\packages\Jlsca\PpvWi\examples> julia main-condavg.jl examples/aes128_mc_ciph_c8bb4cbd817f9bc6ff762dc4298a29e4.trs ERROR: LoadError: LoadError: UndefVarError: @everywhere not defined_
Any ideas?

Sidenote: Tests run inside julia repl ("test Jlsca") work/pass, but the examples no longer work.

Cannot reproduce results from lascar in jlsca

Hi,

I was working on a CPA problem that I was bashing my head in using jlsca and which was trivially solved by lascar and I wanted to understand the difference / my mistake. Here is the data to reproduce:

cpa_data.zip

Here is my code for jlsca:

using Jlsca.Trs
using Jlsca.Sca
using Jlsca.Align
using Plots
using Statistics

fname = "/home/kali/machines/self/hw/cpa/nMY.ts"
keyByteNum = 1
condavg = false;

trs = InspectorTrace(fname)

attack = AesSboxAttack()
attack.xor = true
anal = IncrementalCPA() # Also tested  CPA()

anal.leakages = [HW()] # Also tested with ID(), Bit(0) and all bits

params = DpaAttack(attack,anal)
params.maxCols = 1042
params.maxColsPost = 1042
params.dataOffset = 1
params.targetOffsets = collect(1:16)
params.updateInterval = 10
params.knownKey = missing
params.keepraw = true

getTrs() = trs

@time rankdata = sca(DistributedTrace(getTrs), params, 1, nrTraces);

And here is my code for lascar, which runs perfectly:

import numpy as np 
from lascar import Session, CpaEngine, ConsoleOutputMethod, MatPlotLibOutputMethod, RankProgressionOutputMethod, ScoreProgressionOutputMethod, DictOutputMethod
from lascar.container import TraceBatchContainer
from lascar.tools.aes import sbox

traces = np.load("traces.npy")
values = np.load("pts.npy")


engines = [
        CpaEngine(f"cpa{i}",  lambda v, k, z=i: sbox[v[z] ^ k], range(256))
        for i in range(16)
]


t = TraceBatchContainer(traces, values)
s = Session(t)
s.add_engines(engines)
s.output_method = ConsoleOutputMethod(*engines)

s.run()

If I understand correctly, lascar is using an identity leakage model, but I'm not 100% sure if it doesn't take the hamming weight somewhere still. For the rest, the lascar code - to me - looks identical to what I try to do in jlsca, but I'm probably missing an important step.

Computation of rank data

I used the Jlsca library to perform power analysis attacks for my master's thesis experiment and I would like to know how the rank data is generated. I spent quite a bit of time looking through the code, but I'm not very familiar with the Julia programming language.

Here is the attack that I am running:

trs = InspectorTrace(insfname)

params = DpaAttack(AesSboxAttack(), IncrementalCPA())
params.dataOffset = 1
params.attack.direction = FORWARD
params.analysis.leakages = [HW()]
numberOfTraces = length(trs);

rankData = sca(trs, params, 1, numberOfTraces)
key = getKey(params,rankData)

[feature]ECC cryptography support

Dear Riscure
Are you can implement guesser & selected function for Jlsca?
For example simplifided version of ECC module in Inspector SCA software.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.