Anybody knows this? Program to solve hill cipher.

Please support our C++ advertiser: Programming Forums - DaniWeb Sister Site
Reply

Join Date: Jul 2009
Posts: 3
Reputation: jempag is an unknown quantity at this point 
Solved Threads: 0
jempag jempag is offline Offline
Newbie Poster

Anybody knows this? Program to solve hill cipher.

 
0
  #1
Aug 27th, 2009
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!
Reply With Quote Quick reply to this message  
Join Date: Jun 2009
Posts: 71
Reputation: kolosick.m188 is an unknown quantity at this point 
Solved Threads: 15
kolosick.m188's Avatar
kolosick.m188 kolosick.m188 is offline Offline
Junior Poster in Training

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

 
0
  #2
Sep 1st, 2009
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
There are 10 types of people in the world, those who get this, those who don't, and those who thought this was binary.
Reply With Quote Quick reply to this message  
Join Date: Mar 2008
Posts: 678
Reputation: Sky Diploma is a splendid one to behold Sky Diploma is a splendid one to behold Sky Diploma is a splendid one to behold Sky Diploma is a splendid one to behold Sky Diploma is a splendid one to behold Sky Diploma is a splendid one to behold 
Solved Threads: 101
Sky Diploma's Avatar
Sky Diploma Sky Diploma is offline Offline
Practically a Master Poster

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

 
0
  #3
Sep 1st, 2009
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.
1. Please Mark Your Thread as Solved After Getting Your Answers.
2. Please Use CODE TAGS .
Reply With Quote Quick reply to this message  
Join Date: Jul 2009
Posts: 3
Reputation: jempag is an unknown quantity at this point 
Solved Threads: 0
jempag jempag is offline Offline
Newbie Poster

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

 
0
  #4
Sep 2nd, 2009
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)
Reply With Quote Quick reply to this message  
Join Date: Mar 2008
Posts: 678
Reputation: Sky Diploma is a splendid one to behold Sky Diploma is a splendid one to behold Sky Diploma is a splendid one to behold Sky Diploma is a splendid one to behold Sky Diploma is a splendid one to behold Sky Diploma is a splendid one to behold 
Solved Threads: 101
Sky Diploma's Avatar
Sky Diploma Sky Diploma is offline Offline
Practically a Master Poster

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

 
0
  #5
Sep 2nd, 2009
Well if
we think that

  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.
1. Please Mark Your Thread as Solved After Getting Your Answers.
2. Please Use CODE TAGS .
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:




Views: 634 | Replies: 4
Thread Tools Search this Thread



Tag cloud for C++
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC