in reply to compare string problem

If I try print encode_base64($cipher->encrypt($cmp));

I get AhYQaNeqCn8= and not hED7MTyAXjY=. So it seems your cypher text is wrong.