[Python] Python Elliptic Curve word encrypter

Discussão em 'Python' iniciado por Stack, Janeiro 18, 2025.

  1. Stack

    Stack Membro Participativo

    I've recently been learning python and to kick myself off I decided to try and code a small program that encrypts a User's string/word using the Elliptic Curve Encryption method.

    However I'm having issues with the loops and other certain things.

    import math

    pub = 5
    priv = 19
    m = 91

    word = input("word: ")

    for char in word:
    enc1 = ord(char)*ord(char)
    while pub > 0:
    enc2 = enc1 / m
    enc3 = math.floor(enc2)
    enc4 = enc1 - (enc3*m)
    enc1 = enc4*enc4
    print(enc4)
    pub = pub-1


    The issue I'm having above is that when I run the code it doesn't loop the way I intend it to. Which is to make enc4 a string, such as the inputted word and restart the process for pub amount of times, thus encrypting the input string pub times.

    Continue reading...

Compartilhe esta Página