Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Locked thread
Jonny 290
May 5, 2005



[ASK] me about OS/2 Warp
thats sensible imo, give afreak the weekend to retcon up a plaintext and algorithm to go with the /dev/urandom wild goose chase he just sent all you motherfuckers on

Adbot
ADBOT LOVES YOU

Bloody
Mar 3, 2013

that seems unlikely

ahmeni
May 1, 2005

It's one continuous form where hardware and software function in perfect unison, creating a new generation of iPhone that's better by any measure.
Grimey Drawer
BE SURE TO DRINK YOUR AV-TINE

flakeloaf
Feb 26, 2003

Still better than android clock

the answer is just the ciphertext for next month's problem

Lain Iwakura
Aug 5, 2004

The body exists only to verify one's own existence.

Taco Defender
I'll be posting the plaintext after the CSAW CTF is over

Aquarium of Lies
Feb 5, 2005

sad cutie
:justtrans:

she/her
Taco Defender
I'm just a lurker and don't really know too much about crypto but from the hints given and other people's work I have a plaintext that is mostly not-gibberish. there are a few oddities idk if OSI introduced them or if my logic is buggy somewhere. anyways here's some hashes of the plaintext I got:

sha256 with padding: 6dcd2b86d135b883ec99160b60d983a6458cd759bd49641605b3ebefdafb9867
sha256 with padding removed: b54937e47b1bb6667e869bcde590dbc0b13e1356d69c8568e0d7c23942e37af8

Lain Iwakura
Aug 5, 2004

The body exists only to verify one's own existence.

Taco Defender

Aquarium of Lies posted:

I'm just a lurker and don't really know too much about crypto but from the hints given and other people's work I have a plaintext that is mostly not-gibberish. there are a few oddities idk if OSI introduced them or if my logic is buggy somewhere. anyways here's some hashes of the plaintext I got:

sha256 with padding: 6dcd2b86d135b883ec99160b60d983a6458cd759bd49641605b3ebefdafb9867
sha256 with padding removed: b54937e47b1bb6667e869bcde590dbc0b13e1356d69c8568e0d7c23942e37af8

Can you post a sum of the first 10 bytes?

Aquarium of Lies
Feb 5, 2005

sad cutie
:justtrans:

she/her
Taco Defender

OSI bean dip posted:

Can you post a sum of the first 10 bytes?

e756abd1708aa9af43d44029797c7c8e86f9b7110743eee38012437a01b0d013

Lain Iwakura
Aug 5, 2004

The body exists only to verify one's own existence.

Taco Defender

Aquarium of Lies posted:

e756abd1708aa9af43d44029797c7c8e86f9b7110743eee38012437a01b0d013

you're missing special characters but nonetheless you did get it

Carthag Tuek
Oct 15, 2005

Tider skal komme,
tider skal henrulle,
slægt skal følge slægters gang



:toot:

Aquarium of Lies
Feb 5, 2005

sad cutie
:justtrans:

she/her
Taco Defender
it's a little stranger than that, I get most of the special characters. I actually just had an idea of what the issue may be so let me dig into it before posting any answers.

Aquarium of Lies
Feb 5, 2005

sad cutie
:justtrans:

she/her
Taco Defender
yo OSI I just pmed you cause I want to check some stuff about the result/logic

Lain Iwakura
Aug 5, 2004

The body exists only to verify one's own existence.

Taco Defender

OSI bean dip posted:

you're missing special characters but nonetheless you did get it

i should clarify that said special character was actually dropped after all--i went to double-check the surviving alphabet so you're on the mark here

Aquarium of Lies
Feb 5, 2005

sad cutie
:justtrans:

she/her
Taco Defender
yeah I just pmed you my full plain text based on what we discussed

Lain Iwakura
Aug 5, 2004

The body exists only to verify one's own existence.

Taco Defender
Aquarium of Lies got it. plaintext is what I expected. i'll post the real plaintext when i am done with csaw

while overdue i'll still give ya a tag. probably tomorrow

Carthag Tuek
Oct 15, 2005

Tider skal komme,
tider skal henrulle,
slægt skal følge slægters gang



pls post method

Aquarium of Lies
Feb 5, 2005

sad cutie
:justtrans:

she/her
Taco Defender
I'll post what I did once I started making progress (so after OSI gave away the key and the convo with COACHS SPORT BAR who had some good questions) after OSI posts the plaintext.

burning swine
May 26, 2004



good job deceitful fish box

Lain Iwakura
Aug 5, 2004

The body exists only to verify one's own existence.

Taco Defender

echinopsis posted:

I dot even have the faintest clue how to do anything like this at all

OSI bean dip posted:

I doubt you can decipher your own posting

so i was happy to see echi post in this thread because he was the basis for the text

quote:

I'm 35. Married for 11 years. started this maybe 9 months ago

and yeah I think I will. but ditch is a mean word. I mean these are people.. we're facebook friends.. I'm not a pump and dump kind of dude. But she is muddying the waters. my wife is concerned I have too many on the go, even though I haven't met some of them, you know? And of course I need to respect her needs above anyone elses.

I think the old "slow fade" is going to be my friend here

yeah one thing I am being kinda self aware is that a) this kind of thing in your life kinda takes over, like I'm not as concerned about world peace as I used to be.. and b) I realise it's a great distraction from real life, as in, talking to new girls is always fun and exciting and they say nice things and ya feel good, but it's clearly a distraction and easy to use as an escape. Also I notice the flip side of the coin of the warm fuzzy feelings from them saying nice things is that you can get an ego-dip from a lack of it. Never before have I been so concerned about impressing women..

I wouldn't say I "have" these ladies though. Only 3 of those 6 are "active" and one I haven't met (yet?)..

I know what you mean. at some stage we accept it'll probably have to stop if we are to retain our own relationship.. but it might not be so fun? I guess maybe we would slow it down to threesomes only? inviting another party to join both is significantly less problematic

there are some healthy things that come out of this, some couple have a lot of jealousy in their relationship with one or the other even having friends of the opposite gender but now we are pretty casual about it because the fundamental rule about openness applies across the board. and it's cool to know I could go out drinking and hookup in a bar if I felt the need. there is a large part about encouraging the other to experience all those fun new experiences because some of these experiences really only come from being with new people and the exciting times in new relationships. I want my wife to experience that! she wants me to. and then we have sexy with each other and we have new tricks etc too

well to make it less exciting but more real you need to understand that this open marriage isn't a free for all. emotions and poo poo are involved. how will my wife feel when I meet a girl off tinder at a bar and go back to her place.. well we just don't know but let's give it a shot. and what happens if during this event my wife doesn't feel good by herself at home knowing I'm out chatting up a 21 year old looking to take her back to her place.. well we made it clear she could call and say "this isn't working" and it sounds like a bummer maybe but it's how it has to go


and so I met her. she was into gaming. she had the biggest boobies. she had a couple of drinks and so we went back to her place but her place was a dump! her cat lived in her room. but she wanted a piece of me so I took
off clothes and we tried to have sex. as I have learned now, getting it up when you're not into condoms or used to new people isn't always so easy.. and so at first there was only a poor attempt at sex. then sex actually happened. but then my wife called not feeling that flash about it all so I went home
and this is where we learned that me going off with random young girls is not the key to a happy marriage lol

these were the characters that were kept:

code:
abcdefghjklmnopqrstuvwxyz0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ.?!@$"-() \n
aquarium of lies' answer however was missing the newlines for some reason so i'll need to see their output to understand why my decoding process worked with them and theirs didn't show them? unsure really but if you look in the code block above, a lower-case 'j' was missing and that was done to mess up your answers

the next one i plan to do does not involve deciphering so it should be fun

Captain Foo
May 11, 2004

we vibin'
we slidin'
we breathin'
we dyin'

i see that lowercase 'j' also this was pretty cool and i look forward to the methodpost

BONGHITZ
Jan 1, 1970

OSI bean dip posted:

so i was happy to see echi post in this thread because he was the basis for the text


these were the characters that were kept:

code:
abcdefghjklmnopqrstuvwxyz0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ.?!@$"-() \n
aquarium of lies' answer however was missing the newlines for some reason so i'll need to see their output to understand why my decoding process worked with them and theirs didn't show them? unsure really but if you look in the code block above, a lower-case 'j' was missing and that was done to mess up your answers

the next one i plan to do does not involve deciphering so it should be fun

lol nice choice

Aquarium of Lies
Feb 5, 2005

sad cutie
:justtrans:

she/her
Taco Defender
after COACHS SPORT BAR's questions and OSI's answers I was able to come up with this decryption method:

Python code:
def decrypt(raw, key, alphabet):
    enc_key = [alphabet.index(k) for k in key]
    rotating_key = itertools.cycle(enc_key)

    # per osi, key size dictates block size
    block_size = len(key)

    # there is an additional shift that cycles during decrypt/encrypt
    shift = 0

    outs = 0
    out_string = ''

    for ch in raw:
        outs += 1

        # Find the index in the alphabet
        ch = alphabet.index(ch)

        # Find the adjustment
        adj = next(rotating_key)
        adj += shift

        # Adjust and add the character to the output
        ch = ch - adj
        # Handle underflow by wrapping around
        while ch < 0:
            ch += len(alphabet)
        ch = alphabet[ch]
        out_string += ch

        # Every time we write block_size chars, increment the shift up to a max
        # of the block_size
        if outs % block_size == 0:
            shift = (shift + 1) % (block_size + 1)
    return out_string
let's see what we get with a simple initial alphabet! I left off most special characters at this point as I didn't know what the order should be, so I only looked up to the first special char to check

code:
>>> boffin3.decrypt(raw[:5], key, 'abcdefghijklmnopqrstuvwxyz0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ\n ')
'Hl 25'
gently caress. but we know there's padding at the end, so if we look at the last 13 chars the end of the string should decrypt to the same value; it may not be the actual padding (due to the shift though you could figure out what the shift should be if you wanted) but it should just be a constant away

code:
>>> boffin3.decrypt(raw[-13:], key, 'abcdefghijklmnopqrstuvwxyz0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ\n ')
'qnccdcdccccdc'
close but some chars are 1 too high. after reading through OSI's hints I wondered if the j should be removed.

code:
>>> boffin3.decrypt(raw[-13:], key, 'abcdefghiklmnopqrstuvwxyz0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ\n ')
'roccccccccccc'
>>> boffin3.decrypt(raw[:5], key, 'abcdefghiklmnopqrstuvwxyz0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ\n ')
'Im 35'
that looks like something. at this point I just put $ and @ in the alphabet to decrypt further and look for more plaintext.

code:
>>> boffin3.decrypt(raw[:208], key, 'abcdefghiklmnopqrstuvwxyz0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ$@\n ')
'Im 35W Karried for 11@yearsU started this maybe 9 months agoaaand yeah I think I willU but ditch is a mean '
 'wordU I mean these are peopleUU were facebook friendsUU Cm not a pump and dump kind of dudeU But@she '
at this point the first part of the plaintext is obvious and it's just a matter of tweaking the space of the special characters so things make sense. so for example the 'W' in the plaintext should be a '.', so we know the relative difference of '.' and '$' (4 chars). so I can pad the alphabet until I figure out what should be there and find the next odd character.

code:
>>> boffin3.decrypt(raw[:26], key, 'abcdefghiklmnopqrstuvwxyz0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ.###$@\n ')
'Im 35. Oarried for 11@year'
but you're going to run into a problem with my implementation now. newline chars just won't work and I couldn't get them to work with my code. if you look at the '@' in that sentence, it clearly should be a space, and the offset should be -1 (easy to calculate manually, which I had to do a lot of). so then clearly space should precede newline rather than what I have, but then lots of other stuff goes weird:

code:
>>> boffin3.decrypt(raw[:26], key, 'abcdefghiklmnopqrstuvwxyz0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ.###$@ \n')
'Im\n35.\nOarried\nfor\n11 year'
the @ char is fixed but now all my spaces are newlines

anyways after going through and fixing chars (except newlines) I ended up with this:

code:
>>> msg = boffin3.decrypt(raw, key, 'abcdefghiklmnopqrstuvwxyz0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ.?(@$"-\n) ')
>>> print '\n'.join(textwrap.wrap(repr(msg), 80))
'Im 35. Married for 11-years. started this maybe 9 months agoaaand yeah I think
I will. but ditch is a mean word. I mean these are people.. were facebook
friends.. Im not a pump and dump kind of dude. But-she is muddying the waters.
my wife is concerned I have too many on the go even though I havent met some of
them you know? And of course I need to respect her needs above anyone elses.aaI
think the old "slow fade" is going to be my friend hereaayeah one thing I am
being kinda self aware is that a) this kind of thing in your life kinda takes
over like Im not as concerned about world peace as I used to be.. and b) I
realise its a great distraction from real life as in talking to new girls is
always fun and exciting and they say nice things and ya feel good but its
clearly a distraction and easy to use as an escape. Also I notice the flip side
of the coin of the warm fuzzy feelings from them saying nice things is that you
can get an ego-dip from a lack of it. Never before have I been so concerned
about impressing women..aaI wouldnt say I "have" these ladies though. Only 3 of
those 6 are "active" and-one I havent met \nyet?)..aaI know what you mean. at
some stage we accept itll probably have to stop if we are to retain our own
relationship.. but it might not be so fun? I guess maybe we would slow it down
to threesomes only? inviting another party to oin both is significantly less
problematicaathere are some healthy things that come out of this some couple
have a lot of ealousy in their relationship with one or the other even having
friends of the opposite gender but now we are pretty casual about it because the
fundamental rule about openness applies across the board. and its cool to know I
could go out drinking and hookup in a bar if I felt the need. there is a large
part about encouraging the other to experience all those fun new experiences
because some of these experiences really only come from being with new people
and the exciting times in new relationships. I want my wife to experience that(
she wants me to. and then we have sexy with each other and we have new tricks
etc too aawell to make it less exciting but more real you need to understand
that this open marriage isnt a free for allX emotions and poo poo are involved. how
will my wife feel when D meet a girl off tinder at a bar and go back to her
place.. well we ust dont know but lets give it-a shot. and what happens if
during this event my wife doesnt feel good by herself at home knowing Im out
chatting up a 21 year old looking to take her back to her place.. well we made
it clear she could call and say "this isnt working" and it sounds like a bummer
maybe but its how it has to goaaaand so I met her. she was into gaming. she had
the biggest boobies. she had a couple of drinks and so we went back to her place
but her place was a dump( her cat lived in her room. but she wanted a piece of
me so I tookaoff clothes and we tried to have sex. as I have learned now getting
it up when youre not into condoms or used to new people isnt always so easy..
and so at first there was only a poor attempt at sex. then sex actually
happenedX but then my wife called not feeling that flash about it all so I went
homeaand this is where we learned that me going off with random young girls is
not the key to a happy marriage lol           '
>>> hashlib.sha256(msg).hexdigest()
'6dcd2b86d135b883ec99160b60d983a6458cd759bd49641605b3ebefdafb9867'
I spent a lot of time trying to tweak the alphabet but never really got anything better, so I thought maybe OSI purposefully introduced corruptions so if somebody got part of the way and identified the source they'd couldn't just send that. one thing of note is you'll see "a" where newlines should be consistently (but also legit "a"s). anyways I finally posted this to check (you can see the hashes match) and left to work on something else.


but then I had an idea!! there were two conflicting spots of information. 1) space had to be at the end because that works for 99% and 2) newline has to be after space because of the first newline. so I thought, "what if the encryption code has an off-by-one error introduced when it wraps around the end of the alphabet?" that would explain both scenarios I was seeing and also the thing with newlines becoming "a"s.

so I tweaked the code to introduce my off-by-one error, it's a really minor change:

Python code:
def decrypt(raw, key, alphabet):
    enc_key = [alphabet.index(k) for k in key]
    rotating_key = itertools.cycle(enc_key)

    # per osi, key size dictates block size
    block_size = len(key)

    # there is an additional shift that cycles during decrypt/encrypt
    shift = 0

    outs = 0
    out_string = ''

    for ch in raw:
        outs += 1

        # Find the index in the alphabet
        ch = alphabet.index(ch)

        # Find the adjustment
        adj = next(rotating_key)
        adj += shift

        # Adjust and add the character to the output
        ch = ch - adj
        # Handle underflow by wrapping around
        while ch < 0:
            ch += len(alphabet) - 1 # NOTE encryption has off-by-one error
        ch = alphabet[ch]
        out_string += ch

        # Every time we write block_size chars, increment the shift up to a max
        # of the block_size
        if outs % block_size == 0:
            shift = (shift + 1) % (block_size + 1)
    return out_string
the only change to the original decrypt is with the NOTE comment. then to test:

code:
>>> boffin3.decrypt(raw[:104], key, 'abcdefghiklmnopqrstuvwxyz0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ.?(@$"-) \n')
'Im 35. Married for 11 yearsZ started this maybe 9 months agoaaand yeah I think I willZ but ditch is a me'
that keeps the spaces and the newline-as-a-space, but some other chars are off now so the special chars needs to be tweaked again (similarly to what I did before, just find something that looks weird and fix it). at the end you get

code:
>>> msg = boffin3.decrypt(raw, key, 'abcdefghiklmnopqrstuvwxyz0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ.?!@$"-() \n')
>>> print '\n'.join(textwrap.wrap(repr(msg), 80))
'Im 35. Married for 11 years. started this maybe 9 months agoaaand yeah I think
I will. but ditch is a mean word. I mean these are people.. were facebook
friends.. Im not a pump and dump kind of dude. But she is muddying the waters.
my wife is concerned I have too many on the go even though I havent met some of
them you know? And of course I need to respect her needs above anyone elses.aaI
think the old "slow fade" is going to be my friend hereaayeah one thing I am
being kinda self aware is that a) this kind of thing in your life kinda takes
over like Im not as concerned about world peace as I used to be.. and b) I
realise its a great distraction from real life as in talking to new girls is
always fun and exciting and they say nice things and ya feel good but its
clearly a distraction and easy to use as an escape. Also I notice the flip side
of the coin of the warm fuzzy feelings from them saying nice things is that you
can get an ego-dip from a lack of it. Never before have I been so concerned
about impressing women..aaI wouldnt say I "have" these ladies though. Only 3 of
those 6 are "active" and one I havent met (yet?)..aaI know what you mean. at
some stage we accept itll probably have to stop if we are to retain our own
relationship.. but it might not be so fun? I guess maybe we would slow it down
to threesomes only? inviting another party to oin both is significantly less
problematicaathere are some healthy things that come out of this some couple
have a lot of ealousy in their relationship with one or the other even having
friends of the opposite gender but now we are pretty casual about it because the
fundamental rule about openness applies across the board. and its cool to know I
could go out drinking and hookup in a bar if I felt the need. there is a large
part about encouraging the other to experience all those fun new experiences
because some of these experiences really only come from being with new people
and the exciting times in new relationships. I want my wife to experience that!
she wants me to. and then we have sexy with each other and we have new tricks
etc too aawell to make it less exciting but more real you need to understand
that this open marriage isnt a free for all. emotions and poo poo are involved. how
will my wife feel when I meet a girl off tinder at a bar and go back to her
place.. well we ust dont know but lets give it a shot. and what happens if
during this event my wife doesnt feel good by herself at home knowing Im out
chatting up a 21 year old looking to take her back to her place.. well we made
it clear she could call and say "this isnt working" and it sounds like a bummer
maybe but its how it has to goaaaand so I met her. she was into gaming. she had
the biggest boobies. she had a couple of drinks and so we went back to her place
but her place was a dump! her cat lived in her room. but she wanted a piece of
me so I tookaoff clothes and we tried to have sex. as I have learned now getting
it up when youre not into condoms or used to new people isnt always so easy..
and so at first there was only a poor attempt at sex. then sex actually
happened. but then my wife called not feeling that flash about it all so I went
homeaand this is where we learned that me going off with random young girls is
not the key to a happy marriage lol           '
at this point I pmed OSI to ask about the off-by-one error and he admitted bugs were introduced to make it harder. tricky!!

Pile Of Garbage
May 28, 2007



that owns, thanks for the write-up!

Carthag Tuek
Oct 15, 2005

Tider skal komme,
tider skal henrulle,
slægt skal følge slægters gang



good job

Aquarium of Lies
Feb 5, 2005

sad cutie
:justtrans:

she/her
Taco Defender
glad people enjoyed it, I had fun logic-ing through stuff. looking forward to the next challenge now

Bloody
Mar 3, 2013

i have absolutely no idea how to go from ciphertext to plaintext short of just trying literally every possible approach at once. good poo poo

Loving Africa Chaps
Dec 3, 2007


We had not left it yet, but when I would wake in the night, I would lie, listening, homesick for it already.

I enjoyed that writeup, thanks

anthonypants
May 6, 2007

by Nyc_Tattoo
Dinosaur Gum

Bloody posted:

i have absolutely no idea how to go from ciphertext to plaintext short of just trying literally every possible approach at once. good poo poo
cryptograms are about my speed. here is an example:

https://www.youtube.com/watch?v=BPX-wuplDvc

burning swine
May 26, 2004



Good writeup, good job. I'm glad somebody got it before OSI just gave up all the details.

I distinctly remember seeing 'qnccdcdccccdc' at some point while I was working on this :drat:

Carbon dioxide
Oct 9, 2012

Well done.

Unrelatedly, I suggest adopting the OSI as an unit of encryption puzzle difficulty.

This puzzle was at least 3 OSIs, perhaps even 4.

CRIP EATIN BREAD
Jun 24, 2002

Hey stop worrying bout my acting bitch, and worry about your WACK ass music. In the mean time... Eat a hot bowl of Dicks! Ice T



Soiled Meat
a lurker outdid everyone here and he doesnt even post in the yos

fish guy you should post here more often

Adbot
ADBOT LOVES YOU

HoboMan
Nov 4, 2010

drat i forgot about this. good job fish man sam

e: sorry i got your name wrong Lord Aquarius

HoboMan fucked around with this message at 02:21 on Sep 24, 2016

  • Locked thread