Package info.riemannhypothesis.crypto.tools

Examples of info.riemannhypothesis.crypto.tools.BlockSequence


    String path = "/Users/MarkusSchepke/Downloads/video-task.mp4";
    File file = new File(path);

    FileInputStream fileInputStream = new FileInputStream(file);

    BlockSequence blocks = new BlockSequence(1024, fileInputStream, (int) file.length());
    VideoHash videoHash = new VideoHash();

    // System.out.println("Beginning of the file: " +
    // bytes.toHexString().substring(0, 100));
    System.out.println("Hash: " + videoHash.hash(blocks).toHexString());
View Full Code Here


    String cipher = "f20bdba6ff29eed7b046d1df9fb7000058b1ffb4210a580f748b4ac714c001bd4a61044426fb515dad3f21f18aa577c0bdf302936266926ff37dbf7035d5eeb4";
    final byte blockLength = 16;
    ByteSequence bytes = ByteSequence.fromHexString(cipher);
    ByteSequence plain = ByteSequence.EMPTY_SEQUENCE;
    BlockSequence blocks = new BlockSequence(blockLength, bytes);

    for (int i = 1; i < blocks.length(); i++) {
      ByteSequence iv = blocks.blockAt(i - 1);
      ByteSequence block = blocks.blockAt(i);
      boolean lastBlock = (i == blocks.length() - 1);
      try {
        ByteSequence plainBlock = decryptBlock(iv, block);
        if (lastBlock) {
          byte paddingLength = plainBlock
              .byteAt(plainBlock.length() - 1);
View Full Code Here

TOP

Related Classes of info.riemannhypothesis.crypto.tools.BlockSequence

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.