string encrypt and decrypt

I explored our forum and found encryption but for memoryblock only. I am wondered why XOJO has no string encrypt and decrypt functionality for strings.

Can anybody guide me on how to do the string encryption and decryption?

Strings convert to MemoryBlocks pretty easily because strings are just “a string of bytes”

see the documentation of crypto or new framework, as @Tim Parnell says, is easy. I have a crypto library and use strings, but for convenience, for desktop apps store sensitive data in plain strings are not recommended.

In fact, this works:

dim s as string = "hi"
dim mb as MemoryBlock = s
s.Byte( 0 ) = s.Byte( 0 ) + 2
s = mb // s = "ji"

I review CRYPT RSA from xojo documentation. It demonstrates encrypted string to the memory block. It does not mention there on how to store memoryblock to the string so that it can be saved.

I am planning to use the encryption/decryption for a user password.

Exactly as I illustrated above. A MemoryBlock can be assigned to a string and vice versa.

But you should absolutely not encrypt user passwords. Hash them instead using the native PBKDF2 or Bcrypt or Scrypt from my M_Crypto package. Storing user passwords in any form is considered bad practice.

if you are really serious with your users data, take a look to AuthenticationKit.