How to find encryption method if both encrypted and decrypted code known?


this is a sample encrypted code, how could i identify its method if i know original code?


Depends on how many plaintext-ciphertext pairs you can collect. Potentially, you can infer what mode (e.g. maybe ECB) is used.

On most occasions, though, known plaintext attacks (KPA) are weak against properly designed ciphers as those are designed specifically to thwart at least that type of attacks. This means that collecting and comparing the pairs would yield no information as to which cipher and the encryption key were used to encrypt the text.

So sorry, unless it's a simple XOR with constant keystream, you are unlikely to find out the exact method used with only one text pair.

Not the answer you're looking for? Browse other questions tagged or ask your own question.