rsa_encrypt



  • Hello

    I would like to crypt data with public key to be send to a server with my lopy.
    When, i read the official documentation
    and test the example: the rsa_encrypt function is missing !

    The function rsa_decypt is missing too.

    Traceback (most recent call last):
      File "<stdin>", line 13, in <module>
    AttributeError: 'module' object has no attribute 'rsa_encrypt'
    >
    Pycom MicroPython 1.20.0.rc13 [v1.9.4-94bb382] on 2019-08-22; LoPy with ESP32
    Type "help()" for more information.
    

    Here my code

    # send data to a server
    import crypto
    
    payload = "this is a secret message, it needs to be encrypted"
    
    # read the key from file
    f = open("cert/public_serveur.pem")
    pk = f.read()
    f.close()
    
    # Encrypt the message
    message_encrypted = crypto.rsa_encrypt(payload, pk)
    

    If You have a solution ..
    Thank's


Log in to reply
 

Pycom on Twitter