Did a C++ code on Caesar Cipher to do encryption and decryption with my XMC4500 microcontroller but my lecturer said that Caesar Cipher is too simple. He wants me to use a non basic type of cipher and to include size of bit length of plain text and cipher text, secret and public message number and key. And the problem is no keyboard or display interface will be connected to my microcontroller so i could not use printf, scanf, cout and cin to input any of those values. Any ideas on what Cipher I should use and how I could do it?

UPDATE: Thank you for all the suggestions but my supervisor finally told me to use ASCON instead.


closed as too broad by forest, kelalaka, Maarten Bodewes Apr 19 at 11:50

Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • $\begingroup$ Can't you upload a key? $\endgroup$ – kelalaka Apr 17 at 16:47
  • $\begingroup$ Do you know if you can use symmetric or asymmetric encryption (or both)? 'secret' and 'public message number' sounds like asymmetric cryptography... $\endgroup$ – AleksanderRas Apr 17 at 16:49
  • $\begingroup$ What are you trying to do, beyond implement cryptography? If you just want some cryptodoohickey, I dunno, you could pick up Gimli or something small like that, but it doesn't mean much on its own without a goal that you're trying to accomplish. $\endgroup$ – Squeamish Ossifrage Apr 17 at 17:26
  • $\begingroup$ I can use both symmetric or asymmetric encryption. My lecturer only asked me to implement cryptography into my microcontroller, when I asked for more information, he would just avoid the question or would just reply that I will know it soon. $\endgroup$ – jan Apr 17 at 17:38
  • 1
    $\begingroup$ That chip is loaded with comms possibilities but yes, micro controllers tend not to have keyboards nor displays. Might this be better addressed on the electronics.stackexchange.com forum. Or at least review the datasheet. You can run anything you like crypto wise, that's not a problem. Sounds like the comms is going to be more of an issue for you. $\endgroup$ – Paul Uszak Apr 17 at 20:48

That's a 32 bit ARM chip (M4), but without any hardware based crypto capabilities. That means that the best choice of a cipher is one that runs best on 32 bit CPU's, e.g. ChaCha20, SOSEMANUK or NORX (taken from this answer by Thomas). Of course for transport security you may want to use authenticated encryption, but you can always bold that on (this seems to be an assignment after all).

Above ciphers are good ciphers to try to implement yourself. However, if there are ciphers available in libraries then you may want to use those and safe yourself a lot of time. Before implementing a cipher, make sure that this is the purpose of the assignment!

Note that a cipher in itself does not offer security. You need a security design for your system for that.


Not the answer you're looking for? Browse other questions tagged or ask your own question.