{"id":37193871,"url":"https://github.com/number571/go-cryptopro","last_synced_at":"2026-01-14T22:31:23.370Z","repository":{"id":47006488,"uuid":"400678398","full_name":"number571/go-cryptopro","owner":"number571","description":"ГОСТ функции КриптоПро для языка Go.","archived":true,"fork":false,"pushed_at":"2023-05-11T04:46:20.000Z","size":300,"stargazers_count":17,"open_issues_count":3,"forks_count":11,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-09-25T16:39:53.507Z","etag":null,"topics":["cryptography","golang","gost","library"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/number571.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,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-08-28T01:59:47.000Z","updated_at":"2024-09-18T08:12:44.000Z","dependencies_parsed_at":"2024-06-19T22:49:00.158Z","dependency_job_id":"c49b138d-286a-45fc-9c80-018077b988d4","html_url":"https://github.com/number571/go-cryptopro","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/number571/go-cryptopro","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/number571%2Fgo-cryptopro","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/number571%2Fgo-cryptopro/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/number571%2Fgo-cryptopro/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/number571%2Fgo-cryptopro/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/number571","download_url":"https://codeload.github.com/number571/go-cryptopro/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/number571%2Fgo-cryptopro/sbom","scorecard":{"id":698567,"data":{"date":"2025-08-11","repo":{"name":"github.com/number571/go-cryptopro","commit":"586367d98fc0d603c1573fdc1c9815ee4d9f3d79"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Maintained","score":0,"reason":"project is archived","details":["Warn: Repository is archived."],"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Code-Review","score":0,"reason":"Found 0/15 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'main'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 2 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-22T04:29:22.037Z","repository_id":47006488,"created_at":"2025-08-22T04:29:22.037Z","updated_at":"2025-08-22T04:29:22.037Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28436472,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T21:32:52.117Z","status":"ssl_error","status_checked_at":"2026-01-14T21:32:33.442Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: 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":["cryptography","golang","gost","library"],"created_at":"2026-01-14T22:31:22.553Z","updated_at":"2026-01-14T22:31:23.358Z","avatar_url":"https://github.com/number571.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Go КриптоПро\n\u003e Интерфейсы адаптированы под ядро Tendermint\n\u003e https://github.com/number571/tendermint\n\n### Реализация\n* ГОСТ Р 34.10-2012 (ЭЦП, ЭК)\n* ГОСТ Р 34.11-2012 (Хеширование)\n* ГОСТ Р 34.12-2015 (Шифрование)\n* ГОСТ Р ИСО 28640-2012 (КСГПСЧ)\n\n### Установка\n1. Скачать CSP 5.0 https://www.cryptopro.ru/products/csp/downloads\n2. Разархивировать и установить командой `./install.sh`\n3. Скачать `git clone github.com/number571/go-cryptopro`\n4. Запустить `go run main.go`\n\n### ГОСТ Р 34.10-2012 (ЭЦП)\n\n##### Интерфейсные функции Go\n```go\nfunc GenPrivKey(cfg *Config) error {}\nfunc NewPrivKey(cfg *Config) (PrivKey, error) {}\nfunc LoadPrivKey(pbytes []byte) (PrivKey, error) {}\nfunc (key PrivKey) Bytes() []byte {}\nfunc (key PrivKey) String() string {}\nfunc (key PrivKey) Sign(dbytes []byte) ([]byte, error) {}\nfunc (key PrivKey) PubKey() PubKey {}\nfunc (key PrivKey) Equals(cmp PrivKey) bool {}\nfunc (key PrivKey) Type() string {}\n\nfunc LoadPubKey(pbytes []byte) (PubKey, error) {}\nfunc (key PubKey) Address() Address {}\nfunc (key PubKey) Bytes() []byte {}\nfunc (key PubKey) String() string {}\nfunc (key PubKey) VerifySignature(dbytes, sign []byte) bool {}\nfunc (key PubKey) Equals(cmp PubKey) bool {}\nfunc (key PubKey) Type() string {}\n\nfunc NewBatchVerifier() BatchVerifier {}\nfunc (b *BatchVerifier) Add(key PubKey, message, signature []byte) error {}\nfunc (b *BatchVerifier) Verify() (bool, []bool) {}\n\nfunc NewConfig(prov ProvType, subject, password string) *Config {}\n```\n\n##### Интерфейсные функции Си\n```c\nextern int CreateContainer(BYTE prov, BYTE *container, BYTE *password);\nextern int CheckPrivateKey(BYTE prov, BYTE *container, BYTE *password);\nextern BYTE *SignMessage(BYTE prov, BYTE *container, BYTE *password, BYTE *data, DWORD size, DWORD *dwSigLen);\nextern int VerifySign(BYTE prov, HCRYPTKEY *hKey, BYTE *sign, DWORD dwSigLen, BYTE *data, DWORD size);\nextern int HcryptKey(BYTE prov, HCRYPTPROV *hProv, HCRYPTKEY *hKey, BYTE *container);\nextern int ImportPublicKey(BYTE prov, HCRYPTPROV *hProv, HCRYPTKEY *hKey, BYTE *pkbytes, DWORD keyBlobLen);\nextern BYTE *BytesPublicKey(HCRYPTKEY *hKey, DWORD *size);\n```\n\n##### Пример использования\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\n\tgkeys \"github.com/number571/go-cryptopro/gost_r_34_10_2012\"\n)\n\nfunc main() {\n\tcfg := gkeys.NewConfig(gkeys.K256, \"username\", \"password\")\n\n\terr := gkeys.GenPrivKey(cfg)\n\tif err != nil {\n\t\tfmt.Println(\"Warning: key already exist?\")\n\t}\n\n\tpriv, err := gkeys.NewPrivKey(cfg)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tpub := priv.PubKey()\n\tpbytes := pub.Bytes()\n\n\tmsg := []byte(\"hello, world!\")\n\tsign, err := priv.Sign(msg)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tfmt.Printf(\n\t\t\"Type: %s;\\nPubKey [%dB]: %x;\\nSign [%dB]: %x;\\nSuccess: %t;\\n\",\n\t\tpub.Type(),\n\t\tlen(pbytes),\n\t\tpbytes,\n\t\tlen(sign),\n\t\tsign,\n\t\tpub.VerifySignature(msg, sign),\n\t)\n}\n```\n\n##### Пример вывода\n```\nWarning: key already exist?\nType: ГОСТ Р 34.10-2012 256;\nPubKey [102B]: 5006200000492e00004d41473100020000301306072a85030202230106082a850307010102022f6197366b7cd9fb002ec3b7b8ab066fed6a514617a01c6a3ea5124b6acde80fbdb3004940753e0bb350e3f08f9a778dc87b14836a7d7ecf0ec53e49ccdce28e;\nSign [64B]: d8c136c454da21069a7a7064b8fc6c7034b688a7edd0f0bef65d0cbb83ec851ab55b3ae46b6b344a989880d2563f93a47183bb434c65362590b68f03ef6c8ae2;\nSuccess: true;\n```\n\n### ГОСТ Р 34.10-2012 (ЭК)\n\n##### Интерфейсные функции Go\n```go\nfunc NewPrivKey(cfg *Config) (PrivKey, error) {}\nfunc LoadPrivKey(pbytes []byte) (PrivKey, error) {}\nfunc (key PrivKey) Bytes() []byte {}\nfunc (key PrivKey) String() string {}\nfunc (key PrivKey) Secret(pub PubKey) []byte {}\nfunc (key PrivKey) PubKey() PubKey {}\nfunc (key PrivKey) Equals(cmp PrivKey) bool {}\nfunc (key PrivKey) Type() string {}\n\nfunc LoadPubKey(pbytes []byte) (PubKey, error) {}\nfunc (key PubKey) Address() Address {}\nfunc (key PubKey) Bytes() []byte {}\nfunc (key PubKey) String() string {}\nfunc (key PubKey) Equals(cmp PubKey) bool {}\nfunc (key PubKey) Type() string {}\n```\n\n##### Интерфейсные функции Си\n```c\nextern BYTE *GeneratePrivateKey(BYTE prov, DWORD *size);\nextern BYTE *BytesPrivateKey(BYTE prov, HCRYPTPROV *hProv, HCRYPTKEY *hKey, DWORD *size);\nextern BYTE *BytesPublicKey(HCRYPTPROV *hProv, HCRYPTKEY *hKey, DWORD *size);\nextern BYTE *BytesSessionKey(HCRYPTPROV *hProv, HCRYPTKEY *hSessionKey, HCRYPTKEY *hPubKey, DWORD *size);\nextern int ImportPrivateKey(BYTE prov, HCRYPTPROV *hProv, HCRYPTKEY *hKey, BYTE *pkbytes, DWORD keyBlobLen);\nextern int ImportPublicKey(BYTE prov, HCRYPTPROV *hProv, HCRYPTKEY *hKey, BYTE *pkbytes, DWORD keyBlobLen);\nextern BYTE *SharedSessionKey(HCRYPTPROV *hProv, HCRYPTKEY *hKey, BYTE *pkbytes, DWORD keyBlobLen, DWORD *size);\n```\n\n##### Пример использования\n```go\npackage main\n\nimport (\n\t\"bytes\"\n\t\"fmt\"\n\n\tgkeys \"github.com/number571/go-cryptopro/gost_r_34_10_2012_eph\"\n)\n\nfunc main() {\n\tpriv1, err := gkeys.NewPrivKey(gkeys.K256)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tpriv2, err := gkeys.NewPrivKey(gkeys.K256)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\txchkey1 := priv1.Secret(priv2.PubKey())\n\txchkey2 := priv2.Secret(priv1.PubKey())\n\n\tfmt.Printf(\"Xchkey1: %X;\\nXchkey2: %X;\\nSuccess: %t;\\n\",\n\t\txchkey1,\n\t\txchkey2,\n\t\tbytes.Equal(xchkey1, xchkey2),\n\t)\n}\n```\n\n##### Пример вывода\n```\nXchkey1: A3241280FD2ABBCFEF1D3CEA19FE03291F2EC9441E5C44D8109432ED05345566;\nXchkey2: A3241280FD2ABBCFEF1D3CEA19FE03291F2EC9441E5C44D8109432ED05345566;\nSuccess: true;\n```\n\n### ГОСТ Р 34.11-2012\n\n##### Интерфейсные функции Go\n```go\nfunc New(prov ProvType) Hash {}\nfunc (hasher *Hash) Write(p []byte) (n int, err error) {}\nfunc (hasher *Hash) Sum(p []byte) []byte {}\nfunc (hasher *Hash) Reset() {}\nfunc (hasher *Hash) Size() int {}\nfunc (hasher *Hash) BlockSize() int {}\nfunc (hasher *Hash) Type() string {}\n\nfunc Sum(prov ProvType, data []byte) []byte {}\nfunc NewHMAC(prov ProvType, key []byte) Hash {}\nfunc SumHMAC(prov ProvType, key, data []byte) []byte {}\n```\n\n##### Интерфейсные функции Си\n```c\nextern int NewHash(BYTE prov, HCRYPTPROV *hProv, HCRYPTHASH *hHash);\nextern int WriteHash(HCRYPTHASH *hHash, HCRYPTPROV *hProv, BYTE *data, DWORD size);\nextern int ReadHash(HCRYPTHASH *hHash, HCRYPTPROV *hProv, BYTE *rgbHash, DWORD cbHash);\nextern int WriteStateHash(HCRYPTHASH *hHash, HCRYPTPROV *hProv, BYTE *rgbHash, DWORD cbHash);\nextern int ReadStateHash(HCRYPTHASH *hHash, HCRYPTPROV *hProv, BYTE *rgbHash, DWORD *cbHash);\nextern int CloseHash(HCRYPTHASH *hHash, HCRYPTPROV *hProv);\n```\n\n##### Пример использования \n```go\npackage main\n\nimport (\n\t\"encoding/hex\"\n\t\"fmt\"\n\n\tghash \"github.com/number571/go-cryptopro/gost_r_34_11_2012\"\n)\n\nfunc main() {\n\tmsg := []byte(\"hello, world!\")\n\n\thash := ghash.Sum(ghash.H256, msg)\n\tfmt.Println(hex.EncodeToString(hash))\n}\n```\n\n##### Пример вывода\n```\nf1427470546232ec06d4644282cb5036293480a6c56ea255aa774feeffd1aec2\n```\n\n### ГОСТ Р 34.12-2015\n\n##### Интерфейсные функции Go\n```go\nfunc New(key []byte) (cipher.AEAD, error) {}\nfunc (aead *AEAD) Seal(dst, nonce, plaintext, addData []byte) []byte {}\nfunc (aead *AEAD) Open(dst, nonce, ciphertext, addData []byte) ([]byte, error) {}\nfunc (aead *AEAD) NonceSize() int {}\nfunc (aead *AEAD) Overhead() int {}\n```\n\n##### Интерфейсные функции Си\n```c\nextern int Encrypt(BYTE *data, DWORD dsize, BYTE *key, DWORD ksize, BYTE *iv);\n```\n\n##### Пример использования \n```go\npackage main\n\nimport (\n\t\"bytes\"\n\t\"fmt\"\n\n\tgcipher \"github.com/number571/go-cryptopro/gost_r_34_12_2015\"\n)\n\nfunc main() {\n\tvar (\n\t\topenData = []byte(\"hello\")\n\t\tmainData = []byte(\"ABCDEFGHIJKLMNOPQRSTUVWXYZ\")\n\t\tkey      = []byte(\"qwertyuiopasdfghjklzxcvbnm123456\")\n\t\tnonce    = []byte(\"1234567890123456\")\n\t)\n\n\tfmt.Println(mainData)\n\n\tcphr, err := gcipher.New(key)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tenc := cphr.Seal(nil, nonce, mainData, openData)\n\tfmt.Println(enc)\n\n\tdec, err := cphr.Open(nil, nonce, enc, openData)\n\tfmt.Println(dec, err)\n\n\tfmt.Println(bytes.Equal(mainData, dec))\n}\n```\n\n##### Пример вывода\n```\n[65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90]\n[30 138 37 40 172 162 214 203 167 13 158 58 182 210 53 248 8 91 10 31 7 40 217 234 154 152 205 146 154 232 110 244 21 178 32 20 138 162 66 238 18 82 18 225 247 177 110 149]\n[65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90]\ntrue\n```\n\n### ГОСТ Р ИСО 28640-2012\n\n##### Интерфейсные функции Go\n```go\nfunc Read(p []byte) (int, error) {}\nfunc (r Reader) Read(p []byte) (int, error) {}\nfunc Rand(size int) []byte {}\n```\n\n##### Интерфейсные функции Си\n```c\nextern int Rand(BYTE *output, DWORD size);\n```\n\n##### Пример использования\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\n\tgrand \"github.com/number571/go-cryptopro/gost_r_iso_28640_2012\"\n)\n\nfunc main() {\n\tdata := make([]byte, 16)\n\tgrand.Read(data)\n\n\tfmt.Println(data)\n\tfmt.Println(grand.Rand(32))\n}\n```\n\n##### Пример вывода\n```\n[55 152 51 118 11 127 137 228 120 143 40 127 148 11 7 96]\n[19 244 168 91 189 93 232 8 18 69 164 81 69 248 120 139 166 161 45 137 121 208 61 33 91 7 178 166 45 213 68 196]\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnumber571%2Fgo-cryptopro","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnumber571%2Fgo-cryptopro","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnumber571%2Fgo-cryptopro/lists"}