@SureshPatil/

MajesticCoordinatedSystemsanalysis

Python

No description

fork
loading
Files
  • main.py
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
import time
import random

primes = set()

def isPrime(x):
  for i in range(2, int(x**(0.5))):
    if x%i == 0:
      return False
  return True

def findPrime(number, n):
  if number % 2 == 0:
    number +=1
  while isPrime(number) == False:
    number += 2
  print(number)

# def c2i(c, alphabet):
#   return alphabet.index(c)
#     #"""Returns the index of c in the string alphabet, starting at 0"""
#     # Copy your method from subcipher.py here

# def i2c(i, alphabet):
#   return alphabet[i]
#     #"""Returns the character at index i in alphabet"""
#     # Copy your method from subcipher.py here

# def decodeAutoKey(pLetter, ciphertext, alphabet):
#   message = ''
#   for letter in ciphertext:
#     if len(message) == 0:
#       message += i2c(c2i(letter, alphabet) - c2i(pLetter, alphabet), alphabet)
#     else:
#       message += i2c(c2i(letter, alphabet) - c2i(message[-1], alphabet), alphabet)
#   return message

# print("#1")
# alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
# print(decodeAutoKey('P', 'VOWJVNOBTMBALTBFPWLSG', alphabet))

# print("Message: GIOVAN BATTISTA BELLASO")

# print()
# print("#2")
# for alph in alphabet:
#   print(decodeAutoKey(alph, 'ABBAMHOFGQAUVTLTFPMIHTSQRGHINMXVDMXFUE', alphabet))
# print()
# print('Message: IT IS UNBECOMING FOR YOUNG MEN TO UTTER MAXIMS')

n = 47
start = time.perf_counter()
for x in range(6):
  rando = random.randint(2**(n-1) + 1, 2**n)
  findPrime(rando, n)
end = time.perf_counter()
print(end - start)