Package com.securityinnovation.jNeo.ntruencrypt

Examples of com.securityinnovation.jNeo.ntruencrypt.NtruEncryptKey


        OID     oid,
        String  pubFileName,
        String  privFileName)
        throws IOException, NtruException
    {
        NtruEncryptKey k = NtruEncryptKey.genKey(oid, prng);
       
        FileOutputStream pubFile = new FileOutputStream(pubFileName);
        pubFile.write(k.getPubKey());
        pubFile.close();
       
        FileOutputStream privFile = new FileOutputStream(privFileName);
        privFile.write(k.getPrivKey());
        privFile.close();
    }
View Full Code Here


        // then clean up and return.
        InputStream in = new FileInputStream(keyFile);
        byte buf[] = new byte[(int)fileLength];
        in.read(buf);
        in.close();
        NtruEncryptKey k = new NtruEncryptKey(buf);
        java.util.Arrays.fill(buf, (byte)0);
        return k;
    }
View Full Code Here

        else if (args[0].equals("-encrypt"))
        {
            if (args.length != 3) usage();
            // Setup PRNG
            Random prng = createSeededRandom();
            NtruEncryptKey pubKey = loadKey(pubkeyFile);
            encryptFile(pubKey, prng, args[1], args[2]);
        }
        else if (args[0].equals("-decrypt"))
        {
            if (args.length != 3) usage();
            NtruEncryptKey privKey = loadKey(privkeyFile);
            decryptFile(privKey, args[1], args[2]);
        }
        else
          usage();
    }
View Full Code Here

TOP

Related Classes of com.securityinnovation.jNeo.ntruencrypt.NtruEncryptKey

Copyright © 2018 www.massapicom. 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.