# How does one conduct a known-plaintext attack on an algorithm?

My question is two-fold:

1. Say I am given a total black box and I have n number of plaintexts as inputs that map directly to $$n$$-number of ciphertexts as outputs. This is all I know, and I do not have access to the algorithm. Is it possible to conduct a known-plaintext attack?

2. In the event that I do have access to the algorithm's internals, how would one go about attempting a known-plaintext attack on a cryptosystem? What specific weaknesses or traits in the algorithm would one generally be looking for? Is it algorithm-specific or is there a generic process?

• Yes, known-plaintext attacks require knowledge of the algorithm involved. – SEJPM Feb 15 '20 at 12:22
• Well the first step in a cryptanalysis is to find out which encryption algorithm is being used. One way to do this would be, assuming the plain-texts are chosen randomly, is to see the statistics of the characters of the cipher-texts. Of course this attack will not work on the modern standard encryption algorithms. But with the older ones, like RC4, you can actually do statistical analysis to guess the algorithm being used. Note that if the black box encryption is not a standard one, then it will probably show some patterns -- ( security by obscurity is no more true these days.) – Aven Desta Feb 15 '20 at 16:25
• 2. What specific weaknesses or traits in the algorithm would one generally be looking for? Is it algorithm-specific or is there a generic process? . Lets assume we have a large sample of plain-text, cipher-text pairs. Then there are generic attacks you can do such as statistical analysis, differential analysis (for block ciphers) etc... . There are also algorithm specific attacks, checking wikipedia for each cipher algorithm will be good for that. – Aven Desta Feb 15 '20 at 16:32