Welcome to the Pycom forum Forum
    • \[\[global:header.categories\]\]
    • \[\[global:header.recent\]\]
    • \[\[global:header.tags\]\]
    • \[\[global:header.popular\]\]
    • Login

    Explore Pybytes | Official Documentation | Report a Firmware Bug/Issue | GitHub

    rsa_encrypt

    Scheduled Pinned Locked Moved Discussion
    1 Posts 1 Posters 17 Views 1 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • P Offline
      PhS
      last edited by

      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

      1 Reply Last reply Reply Quote 0

      Hello! It looks like you're interested in this conversation, but you don't have an account yet.

      Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

      With your input, this post could be even better 💗

      Register Login
      • 1 / 1
      • First post
        Last post

      Pycom on Twitter

      Pycom