{"action":"created","issue":{"url":"https://api.github.com/repos/laravel/framework/issues/9054","labels_url":"https://api.github.com/repos/laravel/framework/issues/9054/labels{/name}","comments_url":"https://api.github.com/repos/laravel/framework/issues/9054/comments","events_url":"https://api.github.com/repos/laravel/framework/issues/9054/events","html_url":"https://github.com/laravel/framework/pull/9054","id":84995945,"number":9054,"title":"[5.1] Cleanup the encryptor","user":{"login":"ibrasho","id":188776,"avatar_url":"https://avatars.githubusercontent.com/u/188776?v=3","gravatar_id":"","url":"https://api.github.com/users/ibrasho","html_url":"https://github.com/ibrasho","followers_url":"https://api.github.com/users/ibrasho/followers","following_url":"https://api.github.com/users/ibrasho/following{/other_user}","gists_url":"https://api.github.com/users/ibrasho/gists{/gist_id}","starred_url":"https://api.github.com/users/ibrasho/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ibrasho/subscriptions","organizations_url":"https://api.github.com/users/ibrasho/orgs","repos_url":"https://api.github.com/users/ibrasho/repos","events_url":"https://api.github.com/users/ibrasho/events{/privacy}","received_events_url":"https://api.github.com/users/ibrasho/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":12,"created_at":"2015-06-04T09:09:30Z","updated_at":"2015-06-04T15:02:51Z","closed_at":"2015-06-04T13:17:58Z","pull_request":{"url":"https://api.github.com/repos/laravel/framework/pulls/9054","html_url":"https://github.com/laravel/framework/pull/9054","diff_url":"https://github.com/laravel/framework/pull/9054.diff","patch_url":"https://github.com/laravel/framework/pull/9054.patch"},"body":"I've cleaned up the class, and removed the excess functions (like padding and base64_encodeing) that OpenSSL can accomplish.\r\n\r\nI also removed the `setKey()`, since it's make much since to use the same encrypter with different keys. Just create a new instance if you need a different key.\r\n\r\nAlso, I restored the app.cipher configuration incase someone still needs this. If it's `null` then nothing it falls back to the default.\r\n\r\nWhat do you think?"},"comment":{"url":"https://api.github.com/repos/laravel/framework/issues/comments/108926579","html_url":"https://github.com/laravel/framework/pull/9054#issuecomment-108926579","issue_url":"https://api.github.com/repos/laravel/framework/issues/9054","id":108926579,"user":{"login":"ircmaxell","id":660654,"avatar_url":"https://avatars.githubusercontent.com/u/660654?v=3","gravatar_id":"","url":"https://api.github.com/users/ircmaxell","html_url":"https://github.com/ircmaxell","followers_url":"https://api.github.com/users/ircmaxell/followers","following_url":"https://api.github.com/users/ircmaxell/following{/other_user}","gists_url":"https://api.github.com/users/ircmaxell/gists{/gist_id}","starred_url":"https://api.github.com/users/ircmaxell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ircmaxell/subscriptions","organizations_url":"https://api.github.com/users/ircmaxell/orgs","repos_url":"https://api.github.com/users/ircmaxell/repos","events_url":"https://api.github.com/users/ircmaxell/events{/privacy}","received_events_url":"https://api.github.com/users/ircmaxell/received_events","type":"User","site_admin":false},"created_at":"2015-06-04T15:02:50Z","updated_at":"2015-06-04T15:02:50Z","body":"It's doing that, because the \"128\" in AES-128 means a 128 bit key. So passing a longer key is either an error, or is truncated. OpenSSL picked truncate.\r\n\r\nConsidering openssl doesn't expose a way to get the keysize from the cipher name, I don't see any way to handle this from your side.\r\n\r\nBut I'd argue this is working correctly. If anything, an error that too-long of a key was passed could be added, but that's not trivial, so I think it's fine to leave it as is."}}