{"id":15026724,"url":"https://github.com/mnavarrocarter/fernet","last_synced_at":"2025-10-25T18:03:03.856Z","repository":{"id":40470634,"uuid":"257406539","full_name":"mnavarrocarter/fernet","owner":"mnavarrocarter","description":"A modern PHP implementation of the Fernet message encryption spec for exchanging data securely between parties","archived":false,"fork":false,"pushed_at":"2022-05-06T06:49:14.000Z","size":59,"stargazers_count":7,"open_issues_count":1,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-02T23:42:48.837Z","etag":null,"topics":["aes-128","crypto","encryption","fernet","fernet-encryption","hmac","php","php74"],"latest_commit_sha":null,"homepage":null,"language":"PHP","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/mnavarrocarter.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}},"created_at":"2020-04-20T21:20:43.000Z","updated_at":"2024-06-16T19:06:17.000Z","dependencies_parsed_at":"2022-08-09T21:30:30.699Z","dependency_job_id":null,"html_url":"https://github.com/mnavarrocarter/fernet","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mnavarrocarter%2Ffernet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mnavarrocarter%2Ffernet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mnavarrocarter%2Ffernet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mnavarrocarter%2Ffernet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mnavarrocarter","download_url":"https://codeload.github.com/mnavarrocarter/fernet/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247730069,"owners_count":20986404,"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":["aes-128","crypto","encryption","fernet","fernet-encryption","hmac","php","php74"],"created_at":"2024-09-24T20:04:57.854Z","updated_at":"2025-10-25T18:02:58.835Z","avatar_url":"https://github.com/mnavarrocarter.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"Fernet PHP\n==========\n\nExchange strong encrypted messages effectively and privately between two parties.\n\n## Install\n\n```bash\ncomposer require mnavarrocarter/fernet\n```\n\n## Usage\n\nIt's really easy to get started:\n\n```php\n\n// Instantiate the Fernet class using the static factory and passing the base64url encoded key.\n$fernet = MNC\\Fernet::create('cw_0x689RpI-jtRR7oE8h_eQsKImvJapLeSbXpwF4e4=');\n\n// Then, you can encode messages with your fernet instance\n$token = $fernet-\u003eencode('hello');\n\n// You can then decrypt that token back to the original message\n$message = $fernet-\u003edecode($token);\n```\n\n## What is Fernet?\n\nFernet is a ~~recent~~ not so recent specification for encrypting a message and encode\nit into a secure token with established security practices like block sizing, padding and\nsignature hashing.\n\nEncryption is symmetric using a secret of 32 bytes.\n\nYou can read more details about the specification [here][spec].\n\n[spec]: https://github.com/fernet/spec/blob/master/Spec.md\n\n## Why Fernet?\n\nMainly for three reasons:\n\n**Security:** The spec has been defined by cryptographers, not developers, with well-known,\nlong-established security practices like message padding, standard block sizing, and signature\nverification before decryption.\n\n**Evolvavility:** Every token has a version (the current and only version of Fernet is 0x80).\nThe implementations look at the version to decide how the token will be handled. It's not the\nuser who defines then a set of algorithms, but the spec version. Should common nowadays\nalgorithms become more prone to breaking due advancements in computing power, Fernet can\nsolve this easily by rolling a new version of the Spec.\n\n**Convenience:** Depending on the message, Fernet tokens can be small. They can fit cookie size\nconstraints easily, can be pasted in urls easily too, and shared in requests headers or bodies\nwithout a problem.\n\n## Fernet VS JOSE\nFernet solves all the problems existing with current \"industry-standard\" solutions for\nmessage-exchanging, like the JOSE standards.\n\nI could go on lengthy here, but if you are interested to know why, you can take a look\nat [this article][article].\n\n[article]: https://paragonie.com/blog/2017/03/jwt-json-web-tokens-is-bad-standard-that-everyone-should-avoid\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmnavarrocarter%2Ffernet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmnavarrocarter%2Ffernet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmnavarrocarter%2Ffernet/lists"}