(Part C.3)
 
(4 intermediate revisions by the same user not shown)
Line 12: Line 12:
 
== Part C.3 ==
 
== Part C.3 ==
  
<math> \left[ \begin{array}{ccc}
+
<pre>
1 & 0 & 1 \\
+
%{
0 & 1 & 0 \\
+
  Jeremiah Wise
4 & 0 & 1 \end{array} \right] \times
+
  Homework #3 Part C.3
\left[ \begin{array}{ccc}
+
%}
a & b & c \\
+
clear all
d & e & f \\
+
clc
g & h & i \end{array} \right] =  
+
 
\left[ \begin{array}{ccc}
+
message = [1 0 4; 0 1 0; 1 0 1];
2 & 0 & 0 \\
+
 
0 & 1 & 0 \\
+
encryptedVector = [2 0 0; 0 1 0; 0 0 3];
0 & 0 & 3 \end{array} \right]
+
 
</math>
+
secretMatrix = ((inv(message)) * encryptedVector)
 +
 
 +
%{
 +
  This code produces the matrix:
 +
 
 +
secretMatrix =
 +
 
 +
  -0.6667        0   0.6667
 +
        0   1.0000        0
 +
    4.0000        0   -1.0000
 +
 
 +
%}
 +
 
 +
newMessage = [2 23 3];
 +
 
 +
decryptedMessage = newMessage * inv(secretMatrix)
 +
 
 +
%{
 +
  This code produces the matrix:
 +
 
 +
decryptedMessage =
 +
 
 +
    2    23    5
 +
 
 +
%}
 +
 
 +
</pre>
 +
 
 +
So the decrypted message is BWE!

Latest revision as of 13:47, 19 September 2008

Application of Linearity

Part C.1

If Bob knows the secret matrix used to encrypt the message, He can simply take the inverse of that matrix and multiply the encrypted vector by the inverted matrix.

Part C.2

Yes she can just solve the system of equations represented by the matrix, but in general it is easier to just use matrices to solve such equations.


Part C.3

%{
  Jeremiah Wise
  Homework #3 Part C.3
%}
clear all
clc

message = [1 0 4; 0 1 0; 1 0 1];

encryptedVector = [2 0 0; 0 1 0; 0 0 3];

secretMatrix = ((inv(message)) * encryptedVector)

%{
  This code produces the matrix:

secretMatrix =

   -0.6667         0    0.6667
         0    1.0000         0
    4.0000         0   -1.0000

%}

newMessage = [2 23 3];

decryptedMessage = newMessage * inv(secretMatrix)

%{
  This code produces the matrix:

decryptedMessage =

     2    23     5

%}

So the decrypted message is BWE!

Alumni Liaison

Ph.D. on Applied Mathematics in Aug 2007. Involved on applications of image super-resolution to electron microscopy

Francisco Blanco-Silva