this post was submitted on 29 Jun 2025
3 points (100.0% liked)

C++

2040 readers
1 users here now

The center for all discussion and news regarding C++.

Rules

founded 2 years ago
MODERATORS
 

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.

So, how can I do this in C++? 🤔

Thanks in advance!

you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 2 points 3 days ago* (last edited 3 days ago) (1 children)

Let's solve the first part then.

But I guess that @herzenschein already suggested me a solution...

You could take inspiration from Theodore Tso’s pwgen: https://github.com/tytso/pwgen

[–] [email protected] 1 points 3 days ago

Oh good I had forgotten that part!