Hi! ✌️ I need to generate some string in C++ with random characters that can use all letters from "a" to "z" (include capital letters), and all numbers from 0 to 9 there.
And for examples this should looks somehow like this:
SnHXAsOC5XDYLgiKM5ly
Also I want to encrypt that string then by itself:
SnHXAsOC5XDYLgiKM5ly encrypt with SnHXAsOC5XDYLgiKM5ly key.
This is not doable in c++ unfortunately. Its an old case that’s only doable in f# or turbo pascal because of string handling and cryptography export rules (and possibly copy right)
There are various ways to solve the first part and they're pretty generic, the only "C++-specific" part is whether you'll want to build the string step by step (adding characters) or build in one go then modify (build a prearranged string, for example of a specific size, then modify as needed).
To solve the second part we (you) also need to know the encryption algorithm. "Encrypt" is quite a generic word.