From the post,<p>If you pass a wrong key, aes gem raises an error:<p>decrypted = AES.decrypt(encrypted, "Some other password") #=> aes.rb:76:in `final': bad decrypt (OpenSSL::Cipher::CipherError)<p>I have a small doubt with the above statement, how come the following didn't raise any error?<p>encrypted = AES.encrypt("Super secret message", "password")
decrypted = AES.decrypt(encrypted, "totally wrong password")
decrypted #=> Super secret message<p>In the above, the enc key used was "password" and the dec key used was "totally wrong password". The call to the hex function should have returned "0" for the character pairs in the dec key which should've been the same result for enc key. Why didn't the library raise any error but instead decrypted correctly?<p>PS: I haven't tried it yet and would try to check it out. Just wanted to know if there is already a reason for it.