Examples of DustPRNG


Examples of dust.crypto.DustPRNG

    byte[] data="test data".getBytes();
    byte[] hash=DustUtil.hash(data);
    System.out.println("hash: "+Util.encode(hash));

    DustPRNG prng=new DustPRNG();
    byte[] rb=prng.getBytes(1);
    System.out.println("prng: "+Util.encode(rb));
    rb=prng.getBytes(1);
    System.out.println("prng: "+Util.encode(rb));
    rb=prng.getBytes(10);
    System.out.println("prng: "+Util.encode(rb));
    rb=prng.getBytes(32);
    System.out.println("prng: "+Util.encode(rb));

//    byte[] key=new byte[32];
//    random.nextBytes(key);
//    byte[] iv=new byte[32];
View Full Code Here

Examples of dust.crypto.DustPRNG

    byte[] key=Util.decode("5475e69147a1463ef65116ccd8b3d732ead5ce8b5c9b0e61eb4c218fe6165013");
//    byte[] key=new byte[32];
//    random.nextBytes(key);
    byte[] data="test #3".getBytes();
    DustPRNG entropy=new DustPRNG();

    DustPacket p1=DustPacket.create(key, data, entropy);
    byte[] bytes=p1.getBytes();

    System.out.println("key: "+Util.encode(key));
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.