Created
March 13, 2016 15:06
-
-
Save maqiv/81dc9f7cb6ffc2c91cd5 to your computer and use it in GitHub Desktop.
it-sicherheit lab02 determineKey()
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public int[] determineKey(int keylength, int depth) throws IOException { | |
| totalNumberOfKeysToTest = getNumberOfCandidateKeys(keylength, depth); | |
| numberOfKeysTested = 0; | |
| ByteFrequencyTable[] frequencyTable = getFrequencyTableForKeyLength(keylength); | |
| int[] key = null; | |
| //TODO | |
| KeyGenerator gen = new KeyGenerator(frequencyTable, depth, 0); | |
| while ((key = gen.getNextCandidateKey()) != null) { | |
| if(encryptedZipFile.tryDecryption(key)) { | |
| return key; | |
| } | |
| } | |
| return key; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment