function to encrypt text using pseudorandom numbers onepad encrypt onepad encrypt random seed1 onepad encrypt 6969 69 random seed1 onepad encrypthello 9729 114756 4653 31309 10492 69 292 33 131 61 onepad encrypt1 traceback most recent call last typeerror int object is not iterable onepad encrypt1 1 traceback most recent call last typeerror float object is not iterable function to decrypt text using pseudorandom numbers onepad decrypt onepad decrypt35 onepad decrypt 35 traceback most recent call last indexerror list index out of range random seed1 onepad decrypt9729 114756 4653 31309 10492 69 292 33 131 61 hello function to encrypt text using pseudo random numbers onepad encrypt onepad encrypt random seed 1 onepad encrypt 6969 69 random seed 1 onepad encrypt hello 9729 114756 4653 31309 10492 69 292 33 131 61 onepad encrypt 1 traceback most recent call last typeerror int object is not iterable onepad encrypt 1 1 traceback most recent call last typeerror float object is not iterable function to decrypt text using pseudo random numbers onepad decrypt onepad decrypt 35 onepad decrypt 35 traceback most recent call last indexerror list index out of range random seed 1 onepad decrypt 9729 114756 4653 31309 10492 69 292 33 131 61 hello
import random


class Onepad:
    @staticmethod
    def encrypt(text: str) -> tuple[list[int], list[int]]:
        
        plain = [ord(i) for i in text]
        key = []
        cipher = []
        for i in plain:
            k = random.randint(1, 300)
            c = (i + k) * k
            cipher.append(c)
            key.append(k)
        return cipher, key

    @staticmethod
    def decrypt(cipher: list[int], key: list[int]) -> str:
        
        plain = []
        for i in range(len(key)):
            p = int((cipher[i] - (key[i]) ** 2) / key[i])
            plain.append(chr(p))
        return "".join(plain)


if __name__ == "__main__":
    c, k = Onepad().encrypt("Hello")
    print(c, k)
    print(Onepad().decrypt(c, k))