{"id":41634490,"url":"https://github.com/phayes/decryptpem","last_synced_at":"2026-01-24T14:48:01.064Z","repository":{"id":66541181,"uuid":"105088995","full_name":"phayes/decryptpem","owner":"phayes","description":"Decrypts encrypted PEM files and blocks. Provides (optional) TTY prompt for input for password. ","archived":false,"fork":false,"pushed_at":"2017-09-28T15:39:08.000Z","size":13,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-06-20T12:05:27.954Z","etag":null,"topics":["crypto","cryptography","decrypt","dek","golang","password","pem"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/phayes.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2017-09-28T01:45:54.000Z","updated_at":"2021-06-03T00:46:00.000Z","dependencies_parsed_at":"2023-09-28T08:35:49.170Z","dependency_job_id":null,"html_url":"https://github.com/phayes/decryptpem","commit_stats":{"total_commits":14,"total_committers":1,"mean_commits":14.0,"dds":0.0,"last_synced_commit":"7e4f5bc9a31f874ba3bd68296e656d26e5c807aa"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/phayes/decryptpem","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phayes%2Fdecryptpem","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phayes%2Fdecryptpem/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phayes%2Fdecryptpem/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phayes%2Fdecryptpem/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/phayes","download_url":"https://codeload.github.com/phayes/decryptpem/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phayes%2Fdecryptpem/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28730277,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-24T10:24:43.181Z","status":"ssl_error","status_checked_at":"2026-01-24T10:24:36.112Z","response_time":89,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["crypto","cryptography","decrypt","dek","golang","password","pem"],"created_at":"2026-01-24T14:48:00.941Z","updated_at":"2026-01-24T14:48:01.041Z","avatar_url":"https://github.com/phayes.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Decrypt PEM\n\n[![Build Status](https://travis-ci.org/phayes/decryptpem.svg?branch=master)](https://travis-ci.org/phayes/decryptpem)\n[![Build Status](https://scrutinizer-ci.com/g/phayes/decryptpem/badges/build.png?b=master)](https://scrutinizer-ci.com/g/phayes/decryptpem/build-status/master)\n[![Go Report Card](https://goreportcard.com/badge/github.com/phayes/decryptpem)](https://goreportcard.com/report/github.com/phayes/decryptpem)\n[![Scrutinizer Issues](https://img.shields.io/badge/scrutinizer-issues-blue.svg)](https://scrutinizer-ci.com/g/phayes/decryptpem/issues)\n[![GoDoc](https://godoc.org/github.com/phayes/decryptpem?status.svg)](https://godoc.org/github.com/phayes/decryptpem)\n\nGolang package that decrypts encrypted PEM files and blocks. Provides (optional) TTY prompt for input for password. \n\n## Installation\n\n```\ngo get github.com/phayes/decryptpem\n```\n\n## Example\n```go\n// Get private key, prompt for password and decrypt if necessary\npem, err := decryptpem.DecryptFileWithPrompt(\"/path/to/private_key.pem\")\nif err != nil {\n  log.Fatal(err)\n}\nprivateKey, err := x509.ParsePKCS1PrivateKey(pem.Bytes());\nif err != nil {\n  log.Fatal(err)\n}\n\n\n// It will also work with unencrypted plaintext PEM files\npem, err := decryptpem.DecryptFileWithPrompt(\"/path/to/plaintext_key.pem\") // Will not prompt for pasword.\nif err != nil {\n  log.Fatal(err)\n}\nprivateKey, err := x509.ParsePKCS1PrivateKey(pem.Bytes());\nif err != nil {\n  log.Fatal(err)\n}\n```\n\n## Configuration\n\nThere are two configuration variables provided:\n\n```go\n// PasswordDelay sets the delay for any password tries and retries as a defence against brute force password guessing\n// By default there is no delay\nvar decryptpem.PasswordDelay time.Duration\n\n// MaxTries sets the maximum number of times a password may be tried before erroring out.\n// A MaxTries of 1 means that there is only one try allowed (no retries)\n// A MaxTries of 0 means infinite retries are allowed.\n// When tries run out, an error of x509.IncorrectPasswordError will be returned.\nvar decryptpem.MaxTries int\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphayes%2Fdecryptpem","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fphayes%2Fdecryptpem","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphayes%2Fdecryptpem/lists"}