Encoding passcodes

How do I encode a username and password for a log in screen?

This is all in app lab

Hi @prof.daniel.lazar - we would strongly encourage you not to use usernames & passwords in App Lab if you are creating an app for external use. All data on public projects can be viewed, and is therefore unsecure.

However, if you are doing this as a learning experience and aren’t planning on storing actual people’s passwords, take a look at setKeyValue() and getKeyValue(), both found in the data drawer in the toolbox.

I tried using them, but I don’t know how to.

Hi @prof.daniel.lazar,

When you say you want to encode the username and password, did you mean you’d simply like to store them to retrieve and compare later? Or did you want to somehow encrypt/hash/obscure the data so it’s not simply stored as plaintext?

Hi Frank_w_lee,
I am trying to encrypt my passwords. Can you give my more info how to.

Theres a function called getUserId() that returns a string, you could possibly use this string to encrypt data, so that you have to be on the exact device to get it back.

here’s an example I made:

although it’s in the game lab, it should be portable to the app lab.

hint: look in the console for the values.

Ps: thank you for this challenge, I learned things that I haven’t even thought of researching.

Hi @prof.daniel.lazar,

There is no “encrypt” function in the App Lab toolbox. There can be many different types of encryption algorithms, and without more context and details, it’s hard for me to think of a solution for what you’re asking.

You can manually write an encryption algorithm and run your password through that, but there are no built-in encryption algorithms.