SunQuest
           Security and Cryptography
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsSystem AdministrationSecurity and Cryptography

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
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  
Old March 14th, 2008, 06:21 AM
prcAdap's Avatar
prcAdap prcAdap is offline
Contributing User
Dev Shed Beginner (1000 - 1499 posts) Click here for more information
 
Join Date: Mar 2005
Location: Tír na nÓg
Posts: 1,147 prcAdap User rank is First Lieutenant (10000 - 20000 Reputation Level)prcAdap User rank is First Lieutenant (10000 - 20000 Reputation Level)prcAdap User rank is First Lieutenant (10000 - 20000 Reputation Level)prcAdap User rank is First Lieutenant (10000 - 20000 Reputation Level)prcAdap User rank is First Lieutenant (10000 - 20000 Reputation Level)prcAdap User rank is First Lieutenant (10000 - 20000 Reputation Level)prcAdap User rank is First Lieutenant (10000 - 20000 Reputation Level)prcAdap User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 1 Month 1 Week 7 h 50 sec
Reputation Power: 172
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
The message being encrypted was: 'THE CODE'.
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
And tada the message can be decrypted.

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
The ciphertext is another 4 lines long ...

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
I solved these simultaneous equations and got a = 1/13.
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

Reply With Quote
  #2  
Old March 15th, 2008, 08:02 AM
prcAdap's Avatar
prcAdap prcAdap is offline
Contributing User
Dev Shed Beginner (1000 - 1499 posts) Click here for more information
 
Join Date: Mar 2005
Location: Tír na nÓg
Posts: 1,147 prcAdap User rank is First Lieutenant (10000 - 20000 Reputation Level)prcAdap User rank is First Lieutenant (10000 - 20000 Reputation Level)prcAdap User rank is First Lieutenant (10000 - 20000 Reputation Level)prcAdap User rank is First Lieutenant (10000 - 20000 Reputation Level)prcAdap User rank is First Lieutenant (10000 - 20000 Reputation Level)prcAdap User rank is First Lieutenant (10000 - 20000 Reputation Level)prcAdap User rank is First Lieutenant (10000 - 20000 Reputation Level)prcAdap User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 1 Month 1 Week 7 h 50 sec
Reputation Power: 172
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.

Reply With Quote
  #3  
Old March 15th, 2008, 01:38 PM
fishtoprecords's Avatar
fishtoprecords fishtoprecords is offline
Contributing User
Click here for more information.
 
Join Date: Sep 2007
Location: outside Washington DC
Posts: 964 fishtoprecords User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)fishtoprecords User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)fishtoprecords User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)fishtoprecords User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)fishtoprecords User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)fishtoprecords User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)fishtoprecords User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)fishtoprecords User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)fishtoprecords User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)fishtoprecords User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)fishtoprecords User rank is Lieutenant Colonel (40000 - 50000 Reputation Level) 
Time spent in forums: 1 Week 3 Days 23 h 26 m 10 sec
Reputation Power: 418
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?

Reply With Quote
  #4  
Old March 15th, 2008, 02:07 PM
prcAdap's Avatar
prcAdap prcAdap is offline
Contributing User
Dev Shed Beginner (1000 - 1499 posts) Click here for more information
 
Join Date: Mar 2005
Location: Tír na nÓg
Posts: 1,147 prcAdap User rank is First Lieutenant (10000 - 20000 Reputation Level)prcAdap User rank is First Lieutenant (10000 - 20000 Reputation Level)prcAdap User rank is First Lieutenant (10000 - 20000 Reputation Level)prcAdap User rank is First Lieutenant (10000 - 20000 Reputation Level)prcAdap User rank is First Lieutenant (10000 - 20000 Reputation Level)prcAdap User rank is First Lieutenant (10000 - 20000 Reputation Level)prcAdap User rank is First Lieutenant (10000 - 20000 Reputation Level)prcAdap User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 1 Month 1 Week 7 h 50 sec
Reputation Power: 172
Yes, that about sums it up - I just don't know the lingo to do that, sorry.

Reply With Quote
  #5  
Old March 15th, 2008, 08:27 PM
fishtoprecords's Avatar
fishtoprecords fishtoprecords is offline
Contributing User
Click here for more information.
 
Join Date: Sep 2007
Location: outside Washington DC
Posts: 964 fishtoprecords User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)fishtoprecords User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)fishtoprecords User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)fishtoprecords User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)fishtoprecords User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)fishtoprecords User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)fishtoprecords User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)fishtoprecords User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)fishtoprecords User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)fishtoprecords User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)fishtoprecords User rank is Lieutenant Colonel (40000 - 50000 Reputation Level) 
Time spent in forums: 1 Week 3 Days 23 h 26 m 10 sec
Reputation Power: 418
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.

Reply With Quote
  #6  
Old March 16th, 2008, 11:25 AM
prcAdap's Avatar
prcAdap prcAdap is offline
Contributing User
Dev Shed Beginner (1000 - 1499 posts) Click here for more information
 
Join Date: Mar 2005
Location: Tír na nÓg
Posts: 1,147 prcAdap User rank is First Lieutenant (10000 - 20000 Reputation Level)prcAdap User rank is First Lieutenant (10000 - 20000 Reputation Level)prcAdap User rank is First Lieutenant (10000 - 20000 Reputation Level)prcAdap User rank is First Lieutenant (10000 - 20000 Reputation Level)prcAdap User rank is First Lieutenant (10000 - 20000 Reputation Level)prcAdap User rank is First Lieutenant (10000 - 20000 Reputation Level)prcAdap User rank is First Lieutenant (10000 - 20000 Reputation Level)prcAdap User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 1 Month 1 Week 7 h 50 sec
Reputation Power: 172
Quote:
Originally Posted by fishtoprecords
The general topic ... is linear algebra.
OK, thanks for the pointer.

Reply With Quote
Reply

Viewing: Dev Shed ForumsSystem AdministrationSecurity and Cryptography > Decrypt 2x2 Matrix based problem


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway