• Breaking News

    Sunday, February 25, 2018

    Cryptography finding an input that spits out a specific MD5

    Cryptography finding an input that spits out a specific MD5


    finding an input that spits out a specific MD5

    Posted: 25 Feb 2018 02:22 AM PST

    Hello, this is my first time posting here, I did some research first and no this isn't homework but a challenge I gave myself. I realize this is essentially md5 reversing...

    I wrote a python script that essentially bruteforces md5 until it finds a suitable (randomized) input string that would generate a specific md5 hash (which happens to be in itself a hex-encoded message)

    for instance I am trying to find any sequence of 6 printable ASCIIs that would generate the following 6c696b657465617273696e7261696e2e (I have other blade runner references used as MD5 targets)

    so far, no luck. is 6 even a suitable size for the input? are printable ASCIIs enough ?

    I thought of rewritting it to make use of CUDA or OpenCL but this would go beyond that amount of work I am willing to put into what was originally a sort of inside joke.

    What are the odds I'd find a suitable input by bruteforcing MD5 (on CPU)?

    submitted by /u/throwawaypsycho80
    [link] [comments]

    How easy is it to crack my first encryption algorithm?

    Posted: 24 Feb 2018 09:38 AM PST

    I needed a way to encrypt/decrypt folder names on the fly, without the length of the names increasing, so I decided to try and create a way to mask or obfuscate strings (I'm not sure if that's technically encryption).
    In the end, I decided to just listen to you guys and create a table (encrypted txt file) with a dictionary containing folder names and combinations of 146 valid characters (eg: $j2#:music\n@v8%:photos...).
     
    But it was fun to code that obfuscator, and I was wondering how easy would it have been to a cryptographer to decode my folder names.
    Ok, this is the encryption function.

     

     
    And here's a quick overview of what it does:
     
    1) simple reverse
    2) 'scramble' in this context is to shuffle the letters in a predetermined way according to the string's length.
     
    // a scrambled order for every length from 0 to 255
    const SCRAMBLES = ['0', '0,1', '1,0,2','2,3,0,1','3,0,4,1,2',...
     
    3) the 'shiftScore' is how many characters we move to the right (eg with a value of 2, the character 'a' would be 'c').
    To get that score, I do:
    var score = len + uppercaseAmt + lowercaseAmt + numbersAmt + vowelsAmt + consonantsAmt + symbolsAmt;
     
    if(vowelsAmt > 0){
    score *= vowelsAmt;
    }
     
    4) arrayNum is just the index of the array that I'm going to use to mask the characters.
    eg:
    const CHARS_ORIGINAL = [' ', '0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F','G','H'...
    const CHARS_RANDOM_04 = ['╝','c','A','¬','(','¤','x','P','ÃŽ','ñ','X','┴','W','T','▒','è','┬','Ê','╗'
     
    Using the index from the character in the 'original' array, I replace it with the character in the random array.
     
    5) shiftAndMask() uses the shiftScore to move the index forwards and masks every character.
    To avoid patterns in the word (eg "cheese" would translate to "$n##@#"), the shiftScore is added the index of the previous letter in every iteration of the word.
    Eg:
     
    for(var i = 0; i < text.length; i++){
    (...)
    var index = CHARS_ORIGINAL.indexOf(char);
    (...)
    index += shiftScore + prevIndex;
    (...)
     
    6) the shiftScore and arrayNum need to be saved inside the encrypted word, but we need to mask them.
    shiftScore will be a number from 0 to 146, but to recognize it later I need it to be two characters long, so I convert it to hex, then mask that using the arrayNum, so "F7" would be something like "K£".
     
    7) the arrayNum is simply masked like this:
    var index = CHARS_ORIGINAL.indexOf(arrayNum.toString());
    return CHARS_RANDOM_00[index];
     
    8) return randomCharLeft + text + shiftScore + randomCharRight + arrayNum;
     
    9) scramble again.
     
    10) reverse again.
     
    So.. how amateur was that? Haha. What tools or techniques would someone use to decode that?
     
    Btw, the same input has 9 out of 10 chances of resulting in a different output, because of the 10 "CHARS_RANDOM_n" arrays.
     
    EDIT: the code itself https://codepen.io/anon/pen/qxMVOQ?editors=0010

    submitted by /u/Speckart
    [link] [comments]

    No comments:

    Post a Comment