943,929 Members | Top Members by Rank

Ad:
  • C++ Discussion Thread
  • Unsolved
  • Views: 4236
  • C++ RSS
Aug 27th, 2009
0

Anybody knows this? Program to solve hill cipher.

Expand Post »
Anybody knows how to program a solution to hill cipher, its an encryption and decryption..I'm using 2x2 matrix to decrypt any word, can somebody give me some tips, suggestions or anything that could help me finish my job. Thank you very much!
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
jempag is offline Offline
3 posts
since Jul 2009
Sep 1st, 2009
0

Re: Anybody knows this? Program to solve hill cipher.

You have to get the key and then multiply the key by the text. The decipher key is the inverse of the encipher key in mod whatever
Reputation Points: 16
Solved Threads: 16
Junior Poster in Training
kolosick.m188 is offline Offline
72 posts
since Jun 2009
Sep 1st, 2009
0

Re: Anybody knows this? Program to solve hill cipher.

jempag,

It is kinda hard for anyone, to predict your exact approach into writing a program to either encrypt or decrypt. Even if they are familiar with the cipher.

Therefore, in order for you to get better suggestions I guess it would be compulsory for you to first take the time in explaining the approach by which you wish to achieve your goal. And also provide some code that you have already implemented. When that would be done, It would be easier for everyone to then Understand your approach and might lead into helping you to get the solution.

AS Far as HILL Cipher goes.

Basically You must teach the computer Matrix Multiplication.
Considering that you are using a 2x2 Matrix as a key, I guess it would be quite easy to do so.

Now when you are either Encrypting or Decrypting . Make sure that you use 2 letters(1x2) letter matrix To make multiplication possible.

You could use an Enumeration to make symbolic constants representing each letter and the value for that letter.(This approach would require you to use a tokenizer .)
Last edited by Sky Diploma; Sep 1st, 2009 at 1:07 pm.
Reputation Points: 673
Solved Threads: 125
Practically a Posting Shark
Sky Diploma is offline Offline
818 posts
since Mar 2008
Sep 2nd, 2009
0

Re: Anybody knows this? Program to solve hill cipher.

In decipher you have to get the determinant and its inverse, the formula is determinant=(a*d)-(-b*-c)...what i want to know is how to do it in c++,i'm using array to get the 2x2 matrix...pls help

(sorry for my english)
Reputation Points: 10
Solved Threads: 0
Newbie Poster
jempag is offline Offline
3 posts
since Jul 2009
Sep 2nd, 2009
0

Re: Anybody knows this? Program to solve hill cipher.

Well if
we think that

C++ Syntax (Toggle Plain Text)
  1. int matrix [2][2];
  2. int determinant = ((matrix[0][0])*(matrix[1][1])) - ( (-matrix[0][1])) *(-matrix[1][0]))
Would give up the determinant. I hope i closed all the braces correctly.
Reputation Points: 673
Solved Threads: 125
Practically a Posting Shark
Sky Diploma is offline Offline
818 posts
since Mar 2008

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C++ Forum Timeline: Where To Get G++ for Fedora 11
Next Thread in C++ Forum Timeline: Object detection using Opencv Haar Cascades





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC