Hill cipher , known plaintext attack.

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
0
down vote

favorite












I know the plaintext and ciphertext. I want to find the vector key which is used to encrypt the text.
here is the step I want to do.



  1. The convert the ciphertext and plaintext into matrix of n x n.

  2. Find the inverse of the matrix which is equal to MM-1..

  3. Use the function $k=p-c pmod26$ to get the keys. This function delivered from $C=Pcdot K pmod 26$.

anything else, I missed or wrong?
I cannot implement it in the code, not sure what wrong







share|cite|improve this question






















  • Do you know the block size?
    – Randall
    Aug 24 at 3:42










  • There are several examples on this site and the cryptography stack exchange of KP-attacks on Hill ciphers. Look them up.
    – Henno Brandsma
    Aug 24 at 4:14











  • E.g. math.stackexchange.com/q/982030/4280 is one example.
    – Henno Brandsma
    Aug 24 at 4:17














up vote
0
down vote

favorite












I know the plaintext and ciphertext. I want to find the vector key which is used to encrypt the text.
here is the step I want to do.



  1. The convert the ciphertext and plaintext into matrix of n x n.

  2. Find the inverse of the matrix which is equal to MM-1..

  3. Use the function $k=p-c pmod26$ to get the keys. This function delivered from $C=Pcdot K pmod 26$.

anything else, I missed or wrong?
I cannot implement it in the code, not sure what wrong







share|cite|improve this question






















  • Do you know the block size?
    – Randall
    Aug 24 at 3:42










  • There are several examples on this site and the cryptography stack exchange of KP-attacks on Hill ciphers. Look them up.
    – Henno Brandsma
    Aug 24 at 4:14











  • E.g. math.stackexchange.com/q/982030/4280 is one example.
    – Henno Brandsma
    Aug 24 at 4:17












up vote
0
down vote

favorite









up vote
0
down vote

favorite











I know the plaintext and ciphertext. I want to find the vector key which is used to encrypt the text.
here is the step I want to do.



  1. The convert the ciphertext and plaintext into matrix of n x n.

  2. Find the inverse of the matrix which is equal to MM-1..

  3. Use the function $k=p-c pmod26$ to get the keys. This function delivered from $C=Pcdot K pmod 26$.

anything else, I missed or wrong?
I cannot implement it in the code, not sure what wrong







share|cite|improve this question














I know the plaintext and ciphertext. I want to find the vector key which is used to encrypt the text.
here is the step I want to do.



  1. The convert the ciphertext and plaintext into matrix of n x n.

  2. Find the inverse of the matrix which is equal to MM-1..

  3. Use the function $k=p-c pmod26$ to get the keys. This function delivered from $C=Pcdot K pmod 26$.

anything else, I missed or wrong?
I cannot implement it in the code, not sure what wrong









share|cite|improve this question













share|cite|improve this question




share|cite|improve this question








edited Aug 24 at 15:49









Henno Brandsma

92.5k342100




92.5k342100










asked Aug 24 at 3:34









Da Born

81




81











  • Do you know the block size?
    – Randall
    Aug 24 at 3:42










  • There are several examples on this site and the cryptography stack exchange of KP-attacks on Hill ciphers. Look them up.
    – Henno Brandsma
    Aug 24 at 4:14











  • E.g. math.stackexchange.com/q/982030/4280 is one example.
    – Henno Brandsma
    Aug 24 at 4:17
















  • Do you know the block size?
    – Randall
    Aug 24 at 3:42










  • There are several examples on this site and the cryptography stack exchange of KP-attacks on Hill ciphers. Look them up.
    – Henno Brandsma
    Aug 24 at 4:14











  • E.g. math.stackexchange.com/q/982030/4280 is one example.
    – Henno Brandsma
    Aug 24 at 4:17















Do you know the block size?
– Randall
Aug 24 at 3:42




Do you know the block size?
– Randall
Aug 24 at 3:42












There are several examples on this site and the cryptography stack exchange of KP-attacks on Hill ciphers. Look them up.
– Henno Brandsma
Aug 24 at 4:14





There are several examples on this site and the cryptography stack exchange of KP-attacks on Hill ciphers. Look them up.
– Henno Brandsma
Aug 24 at 4:14













E.g. math.stackexchange.com/q/982030/4280 is one example.
– Henno Brandsma
Aug 24 at 4:17




E.g. math.stackexchange.com/q/982030/4280 is one example.
– Henno Brandsma
Aug 24 at 4:17















active

oldest

votes











Your Answer




StackExchange.ifUsing("editor", function ()
return StackExchange.using("mathjaxEditing", function ()
StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix)
StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["$", "$"], ["\\(","\\)"]]);
);
);
, "mathjax-editing");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "69"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: false,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
noCode: true, onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













 

draft saved


draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f2892752%2fhill-cipher-known-plaintext-attack%23new-answer', 'question_page');

);

Post as a guest



































active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes















 

draft saved


draft discarded















































 


draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f2892752%2fhill-cipher-known-plaintext-attack%23new-answer', 'question_page');

);

Post as a guest













































































這個網誌中的熱門文章

How to combine Bézier curves to a surface?

Mutual Information Always Non-negative

Why am i infinitely getting the same tweet with the Twitter Search API?