MCPcopy Create free account
hub / github.com/subbarayudu-j/TheAlgorithms-Python / getRandomKey

Function getRandomKey

ciphers/affine_cipher.py:67–72  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

65 return plainText
66
67def getRandomKey():
68 while True:
69 keyA = random.randint(2, len(SYMBOLS))
70 keyB = random.randint(2, len(SYMBOLS))
71 if cryptoMath.gcd(keyA, len(SYMBOLS)) == 1:
72 return keyA * len(SYMBOLS) + keyB
73
74if __name__ == '__main__':
75 import doctest

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected