This post has a bizarre mismatch of crypto primitives, and I can honestly say I’ve never seen a system that uses both DES and SHA-512 at the same time. I’d stay very far away from this. Maybe check out tink from Google.
Whaaat is this? Putting up code like that is such a bad idea, the risk that someone copypastas it into something mission critical is too high. Compressing the hash along with the message? Using DES?
I understand the point of this post, which is to understand PGP- in that regard this fails, as it zooms way in on details of algorithm choice and then gets those details wrong.
As an improper educational tool and a potential vulnerability, this post is irresponsible.