Cardozz 46 Share Posted August 11, 2016 I've been trying to solve it for 3 hours lol. This sht is hard! Link to comment Share on other sites More sharing options...
Dreamlicker 750 Share Posted August 11, 2016 If this is a simple substitution cipher, B must be a vowel and Z must be S, T, or L (Or any other letter that can be repeated twice) Link to comment Share on other sites More sharing options...
chaosfurian 15 Share Posted August 11, 2016 It says "decipher is the best chaos wins the prize" Link to comment Share on other sites More sharing options...
Silabsoft 13 Share Posted August 11, 2016 Your assumption is completing disregarding his hint... You're saying his name doesn't work so you need to brute force the key, which is basically saying that the key has nothing to do with his name. I am saying the name may just be a hint that it needs to be deciphered, but its clearly not a standard substitution cipher you can try using basic strategy to crack substitution ciphers 'E' being one of the most used vowels ect. This would indicate it's a more complex cipher probably something that requires a key Sorry guys I officially cracked this one Vigenere cipher I ended up not using a dictionary for cracking but instead just a simply char increment and used a dictionary for validation not the most elegant way of doing it as you have ways mathematically for finding key lengths. If the key was longer I would have been fucked as it stands it took about 4 minutes to run on my computer without utilizing stringbuffers and outputting keys with scores < threshold. public class Dictionary { private Set<String> wordsSet; public Dictionary() throws IOException { Path path = Paths.get("words.txt"); byte[] readBytes = Files.readAllBytes(path); String wordListContents = new String(readBytes, "UTF-8"); String[] words = wordListContents.split("\n"); wordsSet = new HashSet<>(); Collections.addAll(wordsSet, words); } public boolean contains(String word) { return wordsSet.contains(word); } } import java.io.IOException; /** * * @[member='Authorities'] Silabsoft */ public class VigenereCrack { public static void main(String[] args) throws IOException { boolean hasFound = false; String key = "A"; VigenereCrack vc = new VigenereCrack(); while (!hasFound) { vc.setKey(key); String decrypted = vc.decrypt("GBQXVEGXCEXVREW CBX UIGVSYIVRG KLI PRUI TYHRWI FHEH QR D DIWFDXI AVWY XLR IFPPBZZRK PRUI MFRCZIQLK"); double score = vc.validationScore(decrypted); if (score > .90) { System.out.println("Decrypted Message: " + decrypted); hasFound = true; } else{ System.out.println("ATTEMPTED KEY: "+key+" Validation Score:"+score); } key = incrementedAlpha(key); } } private final Dictionary dictionary; public double validationScore(String decryped) { double valid = 0; double total = 0; for (String s : decryped.split(" ")) { if (dictionary.contains(s.toLowerCase())) { valid++; } total++; } return valid / total; } private String key; public VigenereCrack() throws IOException { this.key = ""; dictionary = new Dictionary(); } public String encrypt(String text) { String res = ""; text = text.toUpperCase(); for (int i = 0, j = 0; i < text.length(); i++) { char c = text.charAt(i); if (c < 'A' || c > 'Z') { res += c; continue; } res += (char) ((c + key.charAt(j) - 2 * 'A') % 26 + 'A'); j = ++j % key.length(); } return res; } public String decrypt(String text) { String res = ""; text = text.toUpperCase(); for (int i = 0, j = 0; i < text.length(); i++) { char c = text.charAt(i); if (c < 'A' || c > 'Z') { res += c; continue; } res += (char) ((c - key.charAt(j) + 26) % 26 + 'A'); j = ++j % key.length(); } return res; } public final static char MIN_DIGIT = 'A'; public final static char MAX_DIGIT = 'Z'; public static String incrementedAlpha(String original) { StringBuilder buf = new StringBuilder(original); int index = buf.length() - 1; while (index >= 0) { char c = buf.charAt(index); c++; if (c > MAX_DIGIT) { // overflow, carry one buf.setCharAt(index, MIN_DIGIT); index--; continue; } buf.setCharAt(index, c); return buf.toString(); } // overflow at the first "digit", need to add one more digit buf.insert(0, MIN_DIGIT); return buf.toString(); } public void setKey(String key) { this.key = key; } public static final String VALID_CHARS = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; } Wordlist for project: https://github.com/dwyl/english-words/blob/master/words.txtKey: ENDRE RESULT CONGRATULATIONS YOU DECIPHERED THE CODE PLEASE SEND ME A MESSAGE WITH THE FOLLOWING CODE: ISOLVEDIT Link to comment Share on other sites More sharing options...
Decipher 124 Author Share Posted August 11, 2016 I am saying the name may just be a hint that it needs to be deciphered, but its clearly not a standard substitution cipher you can try using basic strategy to crack substitution ciphers 'E' being one of the most used vowels ect. This would indicate it's a more complex cipher probably something that requires a key Sorry guys I officially cracked this one Vigenere cipher I ended up not using a dictionary for cracking but instead just a simply char increment and used a dictionary for validation not the most elegant way of doing it as you have ways mathematically for finding key lengths. If the key was longer I would have been fucked as it stands it took about 4 minutes to run on my computer without utilizing stringbuffers and outputting keys with scores < threshold. public class Dictionary { private Set<String> wordsSet; public Dictionary() throws IOException { Path path = Paths.get("words.txt"); byte[] readBytes = Files.readAllBytes(path); String wordListContents = new String(readBytes, "UTF-8"); String[] words = wordListContents.split("\n"); wordsSet = new HashSet<>(); Collections.addAll(wordsSet, words); } public boolean contains(String word) { return wordsSet.contains(word); } } import java.io.IOException; /** * * @[member='Authorities'] Silabsoft */ public class VigenereCrack { public static void main(String[] args) throws IOException { boolean hasFound = false; String key = "A"; VigenereCrack vc = new VigenereCrack(); while (!hasFound) { vc.setKey(key); String decrypted = vc.decrypt("GBQXVEGXCEXVREW CBX UIGVSYIVRG KLI PRUI TYHRWI FHEH QR D DIWFDXI AVWY XLR IFPPBZZRK PRUI MFRCZIQLK"); double score = vc.validationScore(decrypted); if (score > .90) { System.out.println("Decrypted Message: " + decrypted); hasFound = true; } else{ System.out.println("ATTEMPTED KEY: "+key+" Validation Score:"+score); } key = incrementedAlpha(key); } } private final Dictionary dictionary; public double validationScore(String decryped) { double valid = 0; double total = 0; for (String s : decryped.split(" ")) { if (dictionary.contains(s.toLowerCase())) { valid++; } total++; } return valid / total; } private String key; public VigenereCrack() throws IOException { this.key = ""; dictionary = new Dictionary(); } public String encrypt(String text) { String res = ""; text = text.toUpperCase(); for (int i = 0, j = 0; i < text.length(); i++) { char c = text.charAt(i); if (c < 'A' || c > 'Z') { res += c; continue; } res += (char) ((c + key.charAt(j) - 2 * 'A') % 26 + 'A'); j = ++j % key.length(); } return res; } public String decrypt(String text) { String res = ""; text = text.toUpperCase(); for (int i = 0, j = 0; i < text.length(); i++) { char c = text.charAt(i); if (c < 'A' || c > 'Z') { res += c; continue; } res += (char) ((c - key.charAt(j) + 26) % 26 + 'A'); j = ++j % key.length(); } return res; } public final static char MIN_DIGIT = 'A'; public final static char MAX_DIGIT = 'Z'; public static String incrementedAlpha(String original) { StringBuilder buf = new StringBuilder(original); int index = buf.length() - 1; while (index >= 0) { char c = buf.charAt(index); c++; if (c > MAX_DIGIT) { // overflow, carry one buf.setCharAt(index, MIN_DIGIT); index--; continue; } buf.setCharAt(index, c); return buf.toString(); } // overflow at the first "digit", need to add one more digit buf.insert(0, MIN_DIGIT); return buf.toString(); } public void setKey(String key) { this.key = key; } public static final String VALID_CHARS = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; } Wordlist for project: https://github.com/dwyl/english-words/blob/master/words.txtKey: ENDRE RESULT CONGRATULATIONS YOU DECIPHERED THE CODE PLEASE SEND ME A MESSAGE WITH THE FOLLOWING CODE: ISOLVEDIT Congratulations to @Silabsoft for solving the cipher! There will be more ciphers to come. Link to comment Share on other sites More sharing options...
chaosfurian 15 Share Posted August 11, 2016 Congratulations to @Silabsoft for solving the cipher! There will be more ciphers to come. BUT BUT WHAT WAS THE PRIZE! Link to comment Share on other sites More sharing options...
Silabsoft 13 Share Posted August 11, 2016 BUT BUT WHAT WAS THE PRIZE! I went to dreambot.org for the prize but all I got was this doge Link to comment Share on other sites More sharing options...
Nex 2542 Share Posted August 11, 2016 I went to dreambot.org for the prize but all I got was this doge thanks doge Link to comment Share on other sites More sharing options...
TechTaco 23 Share Posted August 11, 2016 Good job @@Silabsoft and LMAO at that prize Link to comment Share on other sites More sharing options...
chaosfurian 15 Share Posted August 11, 2016 I went to dreambot.org for the prize but all I got was this doge Doge is love, doge is life. Much wow Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.