Jump to content
Frequently Asked Questions
  • Are you not able to open the client? Try following our getting started guide
  • Still not working? Try downloading and running JarFix
  • Help! My bot doesn't do anything! Enable fresh start in client settings and restart the client
  • How to purchase with PayPal/OSRS/Crypto gold? You can purchase vouchers from other users
  • The Uncrackable Code \COMPETITION/


    Decipher

    Recommended Posts

    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.txt

    Key: ENDRE

    RESULT CONGRATULATIONS YOU DECIPHERED THE CODE PLEASE SEND ME A MESSAGE WITH THE FOLLOWING CODE: ISOLVEDIT

    Link to comment
    Share on other sites

    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.txt

    Key: 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

    Archived

    This topic is now archived and is closed to further replies.

    ×
    ×
    • Create New...

    Important Information

    We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.