I would be much more comfortable with using this if it was written in Go or Rust. Why are we still writing C programs to expose sensitive information when much safer languages exist to handle these?
Writing in C requires care, but the modern day "rewrite it in rust" crusade does feel overblown. C programs are nice -- small and fast.
Anyway, I don't mean to be cocky. A code review is welcome, I'd be curious if I did indeed overlook a security issue.