{"id":20483504,"url":"https://github.com/cbuschka/go-spring-password-encoder","last_synced_at":"2026-04-14T15:32:05.493Z","repository":{"id":57636292,"uuid":"427477694","full_name":"cbuschka/go-spring-password-encoder","owner":"cbuschka","description":"Spring compatible password encoders written in golang","archived":false,"fork":false,"pushed_at":"2021-12-10T08:08:32.000Z","size":28,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-03-05T16:16:33.310Z","etag":null,"topics":["bcrypt","golang","java","password","sha256","spring","spring-boot"],"latest_commit_sha":null,"homepage":"","language":"Go","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/cbuschka.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"license.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-11-12T19:43:52.000Z","updated_at":"2024-07-22T14:00:23.000Z","dependencies_parsed_at":"2022-09-26T20:21:51.624Z","dependency_job_id":null,"html_url":"https://github.com/cbuschka/go-spring-password-encoder","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/cbuschka/go-spring-password-encoder","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cbuschka%2Fgo-spring-password-encoder","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cbuschka%2Fgo-spring-password-encoder/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cbuschka%2Fgo-spring-password-encoder/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cbuschka%2Fgo-spring-password-encoder/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cbuschka","download_url":"https://codeload.github.com/cbuschka/go-spring-password-encoder/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cbuschka%2Fgo-spring-password-encoder/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259971331,"owners_count":22940009,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["bcrypt","golang","java","password","sha256","spring","spring-boot"],"created_at":"2024-11-15T16:17:48.933Z","updated_at":"2026-04-14T15:32:00.470Z","avatar_url":"https://github.com/cbuschka.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# go-spring-password-encoder\n\n[![Build](https://github.com/cbuschka/go-spring-password-encoder/workflows/build/badge.svg)](https://github.com/cbuschka/go-spring-password-encoder) [![Latest Release](https://img.shields.io/github/release/cbuschka/go-spring-password-encoder.svg)](https://github.com/cbuschka/go-spring-password-encoder/releases) [![Go Report Card](https://goreportcard.com/badge/github.com/cbuschka/go-spring-password-encoder)](https://goreportcard.com/report/github.com/cbuschka/go-spring-password-encoder) [![License](https://img.shields.io/github/license/cbuschka/go-spring-password-encoder.svg)](https://github.com/cbuschka/go-spring-password-encoder/blob/main/license.txt)\n\n### Spring compatible password encoders written in golang\n\n## Usage\n\nAdd entry to go.mod file:\n\n```\n[...]\n\ngo 1.16\n\nrequire (\n    github.com/cbuschka/go-spring-password-encoder v1.0.0\n    [...]\n)\n```\n\nimport the package fromn within your code:\n\n```\nimport \"github.com/cbuschka/go-spring-password-encoder\"\n```\n\n### SHA256PasswordEncoder (called StandardPasswordEncoder by spring)\n\nHint: This password encoder is considered legacy and too weak.\n\n#### Hash and encode password\n\n```\nencoder := spring_password_encoder.NewDefaultSHA256PasswordEncoder()\n\nencodedPasswordHash, err := encoder.Encode(\"asdfasdf\")\n```\n\n#### Compare plain text password with hashed password\n\n```\nencoder := spring_password_encoder.NewDefaultSHA256PasswordEncoder()\n\nencodedPasswordHash, err := encoder.Encode(\"asdfasdf\")\n```\n\nSee [sha256 password encoder test](./sha256_password_encoder_test.go)\n\n### BCryptPasswordEncoder\n\n#### Hash and encode password\n\n```\nencoder := spring_password_encoder.NewDefaultBCryptPasswordEncoder()\n\nencodedPasswordHash, err := encoder.Encode(\"asdfasdf\")\n```\n\n#### Compare plain text password with hashed password\n\n```\nencoder := spring_password_encoder.NewDefaultBCryptPasswordEncoder()\n\nencodedPasswordHash, err := encoder.Encode(\"asdfasdf\")\n```\n\nSee [bcrypt password encoder test](./bcrypt_password_encoder_test.go)\n\n## License\n\nCopyright (c) 2021 by [Cornelius Buschka](https://github.com/cbuschka).\n\n[MIT](./license.txt)\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcbuschka%2Fgo-spring-password-encoder","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcbuschka%2Fgo-spring-password-encoder","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcbuschka%2Fgo-spring-password-encoder/lists"}