|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
|
|
#1
|
||||
|
||||
|
Decrypt 2x2 Matrix based problem
Hello all,
This is my first venture into cryptography, so please be nice .The problem is a message is encrypted using a 2x2 matrix. A sample was provided to help understand the mechanics of what is involved in such a task (since I wouldn't have had a clue otherwise). [btw - this is a puzzle for solving co-ordinates for a geocaching thing my dad likes to do]. In the encrypting example provided, A=1, B=2, ... Z=26. The matrix used for encrypting was: Code:
-1 1 1 0 This gives a ciphertext of: -12, 20, -2, 5, -11, 15, -5, 5 I have been given the equation to find A^-1, where A is the encrypting matrix. The inverse matrix is: Code:
0 1 1 1 So, that's how the example went. This is the cyphertext I have to work with: Code:
-13 2 -16 4 4 24 2 20 -5 0 3 18 -24 -6 -16 -2 10 30 -31 -16 I have also been told that the message starts with 'North'. So this is what I tried to do first. I *assumed* (eek) that the person was using the same A=1, B=2 etc... I followed that through to the point where: Code:
14a + 15c = -13 14b + 15d = 2 18a + 20c = -16 18b + 20d = 4 Nah - I don't like that, cause C then equals -0.938 which might have been ok if it was a fraction of 13 I might have kept going - but it isn't. So, it's at this point that I begin to realise that this ciphertext probably has numbers in it. An altogether unrelated conclusion - but probably quite important. So, this is my question - how do you do this backwards. Does the equation to go from A to A^-1 the same as going from A^-1 to A [I guess so, but it's been a long time since I did maths, but (A^-1)^-1 = A right? Like 1/1/A)? I don't know how to get started on this other than what I've already posted (simultaneous equations). Any help would be appreciated. Regards, prcAdap |
|
#2
|
||||
|
||||
|
OK - I just read 'How to post a question' equivalent for this forum.
This is where the puzzle came from. I don't want anyone to do this for me. I just want pointers. Cheers. |
|
#3
|
||||
|
||||
|
I'm not sure I understand the basic operation here.
Are you saying that given vector V and matrix A you calculate V x A to get the cipher text C and C x A^-1 to get V? where 'x' is the usual math dot.product function? |
|
#4
|
||||
|
||||
|
Yes, that about sums it up - I just don't know the lingo to do that, sorry.
|
|
#5
|
||||
|
||||
|
The general topic (in American English at least) is linear algebra. You probably just need some code to do the dot.product, which is simple and should be readily available (I have not looked).
At least its simple for small cases and nice integer numbers. The inverse operation is O(n^2) (or worse, its been a while) and when you are using floating point, the large number of intermediate calculations can cause serious accuracy problems without some non-trivial numeric analysis. But with your small N, its not a problem. |
|
#6
|
||||
|
||||
|
Quote:
|
![]() |
| Viewing: Dev Shed Forums > System Administration > Security and Cryptography > Decrypt 2x2 Matrix based problem |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|