3. Consider the following encryption scheme, parametrized by a number n > 0. The
ID: 3586700 • Letter: 3
Question
3. Consider the following encryption scheme, parametrized by a number n > 0. The message space is M-0,1,cosisting of all bit strings of length n. The keyspace is consisting of all bit strings of length n ercept for the "all zeros" string 00; the key generation algorithm Gen produces a uniformly random element in this set. The encoding and decoding algorithms are identical to those of the one-time pad Enck(m) = mk and Deck(c) = ck. Note that this scheme (Gen, Enc, Dec) is essentially identical to the one-time pad except that the key can never be 0…0. The scheme has the following motivation: Observe that if the key happens to be 00 in the one-time pad then ma0 0 = m, in which case the ciphertext is actually the same as the message-this seems bad for security. This new system avoids the problem by always choosing a nonzero key (which guarantees that the ciphertext and the message are always different) (a) Prove that this scheme does not have perfect secrecy. (Specifically, give two messages mo and mi and a ciphertext c so that the probability of observing c with mo is different from the probability of observing c with mi.) (b) Was this "improvement" really such a good idea after all?Explanation / Answer
// programme for Floyd Warshall formula
#include<stdio.h>
// variety of vertices within the graph
#define V four
/* outline Infinite as an outsized enough worth. This worth are used
for vertices not connected to every different */
#define INF 99999
// A operate to print the answer matrix
void printSolution(int dist[][V]);
// Solves the all-pairs shortest path downside victimization Floyd Warshall formula
void floydWarshall (int graph[][V])
{
/* dist[][] are the output matrix that may finally have the shortest
distances between each try of vertices */
int dist[V][V], i, j, k;
/* Initialize the answer matrix same as input graph matrix. Or
area unit able to} say the initial values of shortest distances are based mostly
on shortest methods considering no intermediate vertex. */
for (i = 0; i < V; i++)
for (j = 0; j < V; j++)
dist[i][j] = graph[i][j];
/* Add all vertices one by one to the set of intermediate vertices.
---> Before begin of a iteration, we've shortest distances between all
pairs of vertices specified the shortest distances think about solely the
vertices in set as intermediate vertices.
----> when the tip of a iteration, vertex no. k is additional to the set of
intermediate vertices and therefore the set becomes */
for (k = 0; k < V; k++)
decide all vertices as supply one by one
for (i = 0; i < V; i++)
choose all vertices as destination for the
// higher than picked supply
for (j = 0; j < V; j++)
the worth of dist[i][j]
if (dist[i][k] + dist[k][j] < dist[i][j])
dist[i][j] = dist[i][k] + dist[k][j];
}
}
}
// Print the shortest distance matrix
printSolution(dist);
}
/* A utility operate to print answer */
void printSolution(int dist[][V])
{
printf ("Following matrix shows the shortest distances"
" between each try of vertices ");
for (int i = 0; i < V; i++)
allow us to produce the subsequent weighted graph
10
(0)------->(3)
| /|
five | |
| | one
|/ |
(1)------->(2)
three */
int graph[V][V] = ,
,
,
};
// Print the answer
floydWarshall(graph);
return 0;
}
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.