GithubHelp home page GithubHelp logo

mthiim / dilithium-java Goto Github PK

View Code? Open in Web Editor NEW
180.0 180.0 11.0 51 KB

Experimental Java implementation of post-quantum crypto algorithm Dilithium (including JCE provider)

License: Apache License 2.0

Java 100.00%

dilithium-java's People

Contributors

cjgulledge avatar mthiim avatar winfamy 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

dilithium-java's Issues

Private Key (Secret Key) length is 2544, It's not match to 2528 (serialize)

Private Key (Secret Key) length is 2544, It's not match to 2528.

Parameter set summary

As far as I know, Private Key length for Dilithium LEVEL2 must be 2528 bytes long.

But, after serializing Private Key using "dilithium-java", byte length is 2544

Test Code :
`

        SecureRandom sr = new SecureRandom();
        KeyPairGenerator kpg = KeyPairGenerator.getInstance("Dilithium");
        kpg.initialize(DilithiumParameterSpec.LEVEL2, sr);			
        KeyPair kp = kpg.generateKeyPair();

        byte[] pubkeyBytes = kp.getPublic().getEncoded(); // This is our bytes to be instantiated
        byte[] seckeyBytes = kp.getPrivate().getEncoded();

        System.out.println("pubKey:"+ pubkeyBytes.length);
        System.out.println("secKey:"+ seckeyBytes.length);

        FileOutputStream fos = new FileOutputStream("dilithium-java-public.key", false);
        fos.write(pubkeyBytes);
        fos.close();

        fos = new FileOutputStream("dilithium-java-secret.key", false);
        fos.write(seckeyBytes);
        fos.close();

`

Console Output:
pubKey:1312
secKey:2544

File Size :
1312 dilithium-java-public.key
2544 dilithium-java-secret.key

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.