JCasC offers standard tools for it. What is wrong with them?
https://github.com/jenkinsci/configuration-as-code-plugin#handling-secrets