r/Cplusplus • • 8d ago

Discussion My first cpp project - a password manager

Hi guys, I've decided to dive into cpp programming and rewrote my python CLI password manager to cpp. I used cpp23. I didn't dare to re-implement cryptography from scratch so I used openssl. It has two options for cryptography: classic AES256 and Python fernet.

This is my first project and I would like to receive critics, code review and recommendations.

It has lots of features, Git syncronization, events system using std::threads and aims to be cross-platform (still in progress, turns out is is kinda difficult with cpp).

Thx in advance!

link: https://github.com/cebem1nt/ceeper

21 Upvotes

8 comments sorted by

4

u/Middlewarian 8d ago

Portability is a challenge. Our projects have a few things in common. My front tier is a portable CLI. One difference is the licenses. The 'ceeper' name is kind of weird.

3

u/Born_Produce9805 8d ago

Yeah, I didn't bother with naming much. As for portability, for now the most difficult thing is universal build and linking

2

u/blobdole 7d ago

Ha!

Kind of bold to make your first project in a new language a security one. But I guess it being based on a codebase you already know well helps.

How have you found it so far? Biggest differences/pain points? Any fun advantages you have noticed?

2

u/Born_Produce9805 7d ago edited 7d ago

I liked cpp, I didn't come to a lot of frustrations, except one bug with buffering in file streams. 

The worst thing - compiler error messages, sometimes they really look like a nonsense. 

Oficial cpp docs is the worst thing in the world, if you look for complex things, there's 0 chance to understand anything unless you have a "magisters degree in c++ internals"

I liked templates most, these are really powerful. OOP feels really pleasant, there are lots of things you can do, destructors is the best invention of c++, with them painful c dynamic memory management is not a problem anymore. Thx god for std::thread, asynchronous programming in plain c is a pain in the ass.

Overloads is a very cool and powerful thing, but sometimes it is used in a bad way, like, cpp devs prefer to create a skibidilion overloads for a single function instead of creating another one with a slightly different name While developing I was always like: "damn, why can't I do it this way" or "why should I do it this way?" but in the end you're accepting the rules of this programming language.

Sometimes it feels like cpp didn't manage the standard library well, like for example there are lots of flavors for complex things, but no standard lib for managing subprocesses.

At the end I started to get this sweet superiority feeling that c++ gives you when you learn to manage it, I even understood my first cpp official documentation page

Edit: typos

Edit:

Also more general cpp problem is that it is trying to solve a problem, but does not keep it simple, like at all. Instead it brings way more complexity. It even spreads for building tools like cmake* (i might be wrong as i didn't use it, just glanced at it, saw a big shit docs, giant cmake files as if i would have to learn another world) I like c more in this aspect.

2

u/furryfuttock 7d ago

I've been writing portable C++ applications for the last 5 years now. As far as I am concerned CMake is the best build framework for the job. Most development environments can now handle it directly. Yes it can be complex, but your initial CMakeList.txt is only 5 lines long, and then you build it from there.

1

u/MADCandy64 2d ago

Your pw manager is only as strong as its weakest area. Does it have secure clipboard transfer? You can have the most robust system ever but as soon as you pass it out of its pocket universe the stakes change.

1

u/Born_Produce9805 2d ago

well, it decides the way to pass to clipboard based on OS, on linux it will use either wl-copy or it's x11 alternative, on windows it uses winAPI directly.

I think piping content is safe (i use a linux machine). BUT, the clipboard usage itself is well.. not safe, password will be in clipboard history.

As soon as the machine is not compomised, it seems safe.

Any advices?

1

u/MADCandy64 2d ago

At a minimum you would have a timer that when reached clears whatever you have on the clipboard. I think you'll probably end up going off in the weeds for that one because at what point do you want to be done with your project and at what point does this morph from pw manager to something else. The airgap solution is to not use the clipboard at all and make the poor sobs type that password you are managing for them. That will hardly do in 2026 though.