0

The encrypted picture should be decrypted by the xor the key using the first byte 0x89 if the of the PNG file and switching the place of the pictures

  • "I really can't get it to work" is not acceptable explanation for stackoverflow. You must edit your answer with a detailed explanation of **how** it isn't working. Include complete stack traces of any exceptions that occur, and any error messages, as well as how the behavior deviates from your expectations. – President James K. Polk May 31 '18 at 18:28

2 Answers2

0

It's hard to understand what exactly don't work: The code you showed? If yes I'm guessing that it's "key_transformator" that is missing. It probably have a function that encode the key based on some algorithm.

Maybe you trying to decrypt a file made by this code (is this a CTF challenge?): Even if you have the missing function you'll still need the original random key. If you have it you need to xor it with the first one you're file and then find a way to understand what was the next key

davdsb
  • 101
  • 1
  • 10
  • It is a ctf challenge and the key tranformator is missing also I’m trying to decrypt it throw the code and I can’t get the original random key maybe throw hex editor – KillerVibe Jun 06 '18 at 16:50
0

The idea is to solve the CSA challenge by your own, not to stackoverflow it ^^

Since challenge only ends up on Sep, I won't post a full solution. Here are few (heavy) tips on how to solve this challenge (png++): 1) KNOWN file format has KNOWN file header. 2) Pay close attention the key size is 4 (not by coincidence). 3) Ask yourself what happens with key_transformation when reaching 0xFF, can it go to 0x100 ??

This above should be suffice for you to write your own decryptor, convert the encrypted.png to flag.pnh & get the flag along with it's 30 points

IdanB
  • 303
  • 4
  • 9
  • Hello idan, do know you when is the last date to solve the challenges? how many challenges do i have to solve or score i need to get to get an interview? i come from a c# (not python) background, will CP consider me as a candidate? how do i know if i will be invited or not? does CP let people know when it's too late to solve challenges? I just couldn't find info online for these questions. Thank you very much (-: – SimpleDesign Sep 01 '18 at 17:42