{"id":286,"date":"2013-01-09T16:49:50","date_gmt":"2013-01-09T16:49:50","guid":{"rendered":"16a5cdae362b8d27a1d8f8c7b78b4330"},"modified":"2013-01-09T16:49:50","modified_gmt":"2013-01-09T16:49:50","slug":"","status":"publish","type":"post","link":"https:\/\/www.xiaobo.li\/notes\/archives\/286","title":{"rendered":"php aes"},"content":{"rendered":"<pre class=\"brush:php; toolbar: true; auto-links: true;\">\/**\r\n * aes\r\n *\r\n *\/\r\nclass aes{\r\n    private $key = \"wt@36\";\r\n    private $iv         = \"8401948501850295\"; \/\/\u53ea\u80fd\u662f16\u5b57\u8282\r\n \r\n    \/**\r\n     * \r\n     * @param unknown_type $key\r\n     * @param string $iv   16 length\r\n     *\/\r\n    function __construct($key,$iv=null){\r\n        $this-&gt;key = $key;\r\n        if (!empty($iv)){\r\n         $this-&gt;iv = $iv;\r\n        }\r\n    }\r\n \r\n    \/**\r\n     * \u52a0\u5bc6\r\n     * @param string $value\r\n     * @return string\r\n     *\/\r\n    function encrypt($value){\r\n     return bin2hex(mcrypt_encrypt(MCRYPT_RIJNDAEL_128, $this-&gt;key, $value, MCRYPT_MODE_CBC,$this-&gt;iv));\r\n    }\r\n    \r\n    \/*\r\n     * AES\u89e3\u5bc6\r\n    *\/\r\n    function decrypt($value){\r\n     return mcrypt_decrypt(MCRYPT_RIJNDAEL_128, $this-&gt;key, pack(\"H*\",$value),MCRYPT_MODE_CBC, $this-&gt;iv);\r\n    }\r\n}<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\/**<br \/>\n&nbsp;* aes<br \/>\n&nbsp;*<br \/>\n&nbsp;*\/<br \/>\nclass aes{<br \/>\n&nbsp;&nbsp;&nbsp; private $key = \"<a href=\"mailto:ef955ctg@%T7y#@$%@&amp;YU#4623465@#Yhwt@36\">wt@36<\/a>\";<br \/>\n&nbsp;&nbsp;&nbsp; private $iv&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = \"8401948501850295\";&nbsp;\/\/\u53ea\u80fd\u662f16\u5b57\u8282<br \/>\n&nbsp;<br \/>\n&nbsp;&nbsp;&nbsp; \/**<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp; * <br \/>\n&nbsp;&nbsp;&nbsp;&nbsp; ... <a href=\"https:\/\/www.xiaobo.li\/notes\/archives\/286\">\u7ee7\u7eed\u9605\u8bfb <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[278],"tags":[103,27],"class_list":["post-286","post","type-post","status-publish","format-standard","hentry","category-php","tag-aes","tag-php"],"_links":{"self":[{"href":"https:\/\/www.xiaobo.li\/notes\/wp-json\/wp\/v2\/posts\/286","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.xiaobo.li\/notes\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.xiaobo.li\/notes\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.xiaobo.li\/notes\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.xiaobo.li\/notes\/wp-json\/wp\/v2\/comments?post=286"}],"version-history":[{"count":0,"href":"https:\/\/www.xiaobo.li\/notes\/wp-json\/wp\/v2\/posts\/286\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.xiaobo.li\/notes\/wp-json\/wp\/v2\/media?parent=286"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.xiaobo.li\/notes\/wp-json\/wp\/v2\/categories?post=286"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.xiaobo.li\/notes\/wp-json\/wp\/v2\/tags?post=286"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}