Encryption Validity
Encryption is the process of converting information algorithmically so that a valid recipient can read the information before it is no longer a valuable secret.
This is its validity period. An attacker has limited processing power and can only test a certain number of keys per second.
This is the instruction count. The size of the universe of keys divided by the instruction count gives the average time to find a message key.
To achieve a balance between the processing power for encryption/ decryption and the strength of the encryption, the validity period of the message must be taken into consideration.
Given the number of keys, a hijacker can test per second, determine if the encrypted information should remain confidential throughout its validity period. Each test will return two items of information as integers:
The strength of the encryption is determined as follows:
keys[i], that act as keys.degree of divisibility of an element is the number of elements in the set keys that are greater than 1 and are divisors of the element, i.e element modulo divisor = 0.(the degree of divisibility of m) * 10^5 Complete the function encryptionValidity.
encryptionValidity has the following parameter(s):
int instructionCount: the number of keys the hijacker can test per second int validityPeriod: the number of seconds the message must be protected.int keys[n]: the keys for encryption/decryption1Example 1
Constraints
Limits and guarantees your solution can rely on.
1 <= instructionCount, validityPeriod <= 10^81 <= 1 <= n <= 1051 <= 1<= keys[i] <= 105