huanghongfa
2020-12-22 b135062c01f03ec23231bfe29950d6dbe4f880bb
aes加密问题
5个文件已修改
100 ■■■■■ 已修改文件
springcloud_k8s_panzhihuazhihuishequ/.idea/workspace.xml 85 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/controller/BaseController.java 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/utlis/AES.java 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/target/classes/com/panzhihua/common/controller/BaseController.class 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/target/classes/com/panzhihua/common/utlis/AES.class 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/.idea/workspace.xml
@@ -25,6 +25,9 @@
    <list default="true" id="8ba27629-3e5d-4f42-993e-d0c055bc9371" name="Default Changelist" comment="">
      <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
      <change beforePath="$PROJECT_DIR$/common/src/main/java/com/panzhihua/common/controller/BaseController.java" beforeDir="false" afterPath="$PROJECT_DIR$/common/src/main/java/com/panzhihua/common/controller/BaseController.java" afterDir="false" />
      <change beforePath="$PROJECT_DIR$/common/src/main/java/com/panzhihua/common/utlis/AES.java" beforeDir="false" afterPath="$PROJECT_DIR$/common/src/main/java/com/panzhihua/common/utlis/AES.java" afterDir="false" />
      <change beforePath="$PROJECT_DIR$/common/target/classes/com/panzhihua/common/controller/BaseController.class" beforeDir="false" afterPath="$PROJECT_DIR$/common/target/classes/com/panzhihua/common/controller/BaseController.class" afterDir="false" />
      <change beforePath="$PROJECT_DIR$/common/target/classes/com/panzhihua/common/utlis/AES.class" beforeDir="false" />
    </list>
    <option name="SHOW_DIALOG" value="false" />
    <option name="HIGHLIGHT_CONFLICTS" value="true" />
@@ -111,7 +114,7 @@
      </set>
    </option>
  </component>
  <component name="RunManager" selected="Spring Boot.EurekaServerApplication">
  <component name="RunManager" selected="Application.BaseController">
    <configuration name="AES" type="Application" factoryName="Application" temporary="true" nameIsGenerated="true">
      <option name="MAIN_CLASS_NAME" value="com.panzhihua.common.utlis.AES" />
      <module name="common" />
@@ -138,6 +141,19 @@
        <option name="Make" enabled="true" />
      </method>
    </configuration>
    <configuration name="BaseController" type="Application" factoryName="Application" temporary="true" nameIsGenerated="true">
      <option name="MAIN_CLASS_NAME" value="com.panzhihua.common.controller.BaseController" />
      <module name="common" />
      <extension name="coverage">
        <pattern>
          <option name="PATTERN" value="com.panzhihua.common.controller.*" />
          <option name="ENABLED" value="true" />
        </pattern>
      </extension>
      <method v="2">
        <option name="Make" enabled="true" />
      </method>
    </configuration>
    <configuration name="CommonApi" type="Application" factoryName="Application" temporary="true" nameIsGenerated="true">
      <option name="MAIN_CLASS_NAME" value="com.panzhihua.applets.api.CommonApi" />
      <module name="applets" />
@@ -157,19 +173,6 @@
      <extension name="coverage">
        <pattern>
          <option name="PATTERN" value="com.panzhihua.common.utlis.*" />
          <option name="ENABLED" value="true" />
        </pattern>
      </extension>
      <method v="2">
        <option name="Make" enabled="true" />
      </method>
    </configuration>
    <configuration name="UserServiceImpl" type="Application" factoryName="Application" temporary="true" nameIsGenerated="true">
      <option name="MAIN_CLASS_NAME" value="com.panzhihua.service_user.service.impl.UserServiceImpl" />
      <module name="service_user" />
      <extension name="coverage">
        <pattern>
          <option name="PATTERN" value="com.panzhihua.service_user.service.impl.*" />
          <option name="ENABLED" value="true" />
        </pattern>
      </extension>
@@ -261,7 +264,6 @@
      </method>
    </configuration>
    <list>
      <item itemvalue="Application.UserServiceImpl" />
      <item itemvalue="Application.SFTPUtil" />
      <item itemvalue="Application.AESUtils" />
      <item itemvalue="Application.AES" />
@@ -276,14 +278,15 @@
      <item itemvalue="Spring Boot.ServiceUserApplication" />
      <item itemvalue="Spring Boot.ZuulApplication" />
      <item itemvalue="Spring Boot.ServiceCommunityApplication" />
      <item itemvalue="Application.BaseController" />
    </list>
    <recent_temporary>
      <list>
        <item itemvalue="Application.BaseController" />
        <item itemvalue="Application.CommonApi" />
        <item itemvalue="Application.AES" />
        <item itemvalue="Application.AESUtils" />
        <item itemvalue="Application.SFTPUtil" />
        <item itemvalue="Application.UserServiceImpl" />
      </list>
    </recent_temporary>
  </component>
@@ -374,7 +377,7 @@
      <workItem from="1608371107059" duration="646000" />
      <workItem from="1608371917868" duration="79000" />
      <workItem from="1608379508016" duration="46000" />
      <workItem from="1608531425658" duration="42253000" />
      <workItem from="1608531425658" duration="44039000" />
    </task>
    <servers />
  </component>
@@ -426,54 +429,54 @@
      <screen x="0" y="0" width="1536" height="824" />
    </state>
    <state x="549" y="167" key="FileChooserDialogImpl/0.0.1536.824@0.0.1536.824" timestamp="1606197830966" />
    <state width="1031" height="342" key="GridCell.Tab.0.bottom" timestamp="1608631764049">
    <state width="1493" height="321" key="GridCell.Tab.0.bottom" timestamp="1608633761378">
      <screen x="0" y="0" width="1536" height="824" />
    </state>
    <state width="1031" height="342" key="GridCell.Tab.0.bottom/0.0.1536.824@0.0.1536.824" timestamp="1608631764049" />
    <state width="1031" height="342" key="GridCell.Tab.0.center" timestamp="1608631764049">
    <state width="1493" height="321" key="GridCell.Tab.0.bottom/0.0.1536.824@0.0.1536.824" timestamp="1608633761378" />
    <state width="1493" height="321" key="GridCell.Tab.0.center" timestamp="1608633761378">
      <screen x="0" y="0" width="1536" height="824" />
    </state>
    <state width="1031" height="342" key="GridCell.Tab.0.center/0.0.1536.824@0.0.1536.824" timestamp="1608631764049" />
    <state width="1031" height="342" key="GridCell.Tab.0.left" timestamp="1608631764049">
    <state width="1493" height="321" key="GridCell.Tab.0.center/0.0.1536.824@0.0.1536.824" timestamp="1608633761378" />
    <state width="1493" height="321" key="GridCell.Tab.0.left" timestamp="1608633761377">
      <screen x="0" y="0" width="1536" height="824" />
    </state>
    <state width="1031" height="342" key="GridCell.Tab.0.left/0.0.1536.824@0.0.1536.824" timestamp="1608631764049" />
    <state width="1031" height="342" key="GridCell.Tab.0.right" timestamp="1608631764049">
    <state width="1493" height="321" key="GridCell.Tab.0.left/0.0.1536.824@0.0.1536.824" timestamp="1608633761377" />
    <state width="1493" height="321" key="GridCell.Tab.0.right" timestamp="1608633761378">
      <screen x="0" y="0" width="1536" height="824" />
    </state>
    <state width="1031" height="342" key="GridCell.Tab.0.right/0.0.1536.824@0.0.1536.824" timestamp="1608631764049" />
    <state width="1031" height="342" key="GridCell.Tab.1.bottom" timestamp="1608631764049">
    <state width="1493" height="321" key="GridCell.Tab.0.right/0.0.1536.824@0.0.1536.824" timestamp="1608633761378" />
    <state width="1031" height="342" key="GridCell.Tab.1.bottom" timestamp="1608633465648">
      <screen x="0" y="0" width="1536" height="824" />
    </state>
    <state width="1031" height="342" key="GridCell.Tab.1.bottom/0.0.1536.824@0.0.1536.824" timestamp="1608631764049" />
    <state width="1031" height="342" key="GridCell.Tab.1.center" timestamp="1608631764049">
    <state width="1031" height="342" key="GridCell.Tab.1.bottom/0.0.1536.824@0.0.1536.824" timestamp="1608633465648" />
    <state width="1031" height="342" key="GridCell.Tab.1.center" timestamp="1608633465648">
      <screen x="0" y="0" width="1536" height="824" />
    </state>
    <state width="1031" height="342" key="GridCell.Tab.1.center/0.0.1536.824@0.0.1536.824" timestamp="1608631764049" />
    <state width="1031" height="342" key="GridCell.Tab.1.left" timestamp="1608631764049">
    <state width="1031" height="342" key="GridCell.Tab.1.center/0.0.1536.824@0.0.1536.824" timestamp="1608633465648" />
    <state width="1031" height="342" key="GridCell.Tab.1.left" timestamp="1608633465648">
      <screen x="0" y="0" width="1536" height="824" />
    </state>
    <state width="1031" height="342" key="GridCell.Tab.1.left/0.0.1536.824@0.0.1536.824" timestamp="1608631764049" />
    <state width="1031" height="342" key="GridCell.Tab.1.right" timestamp="1608631764049">
    <state width="1031" height="342" key="GridCell.Tab.1.left/0.0.1536.824@0.0.1536.824" timestamp="1608633465648" />
    <state width="1031" height="342" key="GridCell.Tab.1.right" timestamp="1608633465648">
      <screen x="0" y="0" width="1536" height="824" />
    </state>
    <state width="1031" height="342" key="GridCell.Tab.1.right/0.0.1536.824@0.0.1536.824" timestamp="1608631764049" />
    <state width="1031" height="342" key="GridCell.Tab.2.bottom" timestamp="1608631764049">
    <state width="1031" height="342" key="GridCell.Tab.1.right/0.0.1536.824@0.0.1536.824" timestamp="1608633465648" />
    <state width="1031" height="342" key="GridCell.Tab.2.bottom" timestamp="1608633465648">
      <screen x="0" y="0" width="1536" height="824" />
    </state>
    <state width="1031" height="342" key="GridCell.Tab.2.bottom/0.0.1536.824@0.0.1536.824" timestamp="1608631764049" />
    <state width="1031" height="342" key="GridCell.Tab.2.center" timestamp="1608631764049">
    <state width="1031" height="342" key="GridCell.Tab.2.bottom/0.0.1536.824@0.0.1536.824" timestamp="1608633465648" />
    <state width="1031" height="342" key="GridCell.Tab.2.center" timestamp="1608633465648">
      <screen x="0" y="0" width="1536" height="824" />
    </state>
    <state width="1031" height="342" key="GridCell.Tab.2.center/0.0.1536.824@0.0.1536.824" timestamp="1608631764049" />
    <state width="1031" height="342" key="GridCell.Tab.2.left" timestamp="1608631764049">
    <state width="1031" height="342" key="GridCell.Tab.2.center/0.0.1536.824@0.0.1536.824" timestamp="1608633465648" />
    <state width="1031" height="342" key="GridCell.Tab.2.left" timestamp="1608633465648">
      <screen x="0" y="0" width="1536" height="824" />
    </state>
    <state width="1031" height="342" key="GridCell.Tab.2.left/0.0.1536.824@0.0.1536.824" timestamp="1608631764049" />
    <state width="1031" height="342" key="GridCell.Tab.2.right" timestamp="1608631764049">
    <state width="1031" height="342" key="GridCell.Tab.2.left/0.0.1536.824@0.0.1536.824" timestamp="1608633465648" />
    <state width="1031" height="342" key="GridCell.Tab.2.right" timestamp="1608633465648">
      <screen x="0" y="0" width="1536" height="824" />
    </state>
    <state width="1031" height="342" key="GridCell.Tab.2.right/0.0.1536.824@0.0.1536.824" timestamp="1608631764049" />
    <state width="1031" height="342" key="GridCell.Tab.2.right/0.0.1536.824@0.0.1536.824" timestamp="1608633465648" />
    <state x="299" y="67" key="Maven.ArtifactSearchDialog" timestamp="1606714311663">
      <screen x="0" y="0" width="1536" height="824" />
    </state>
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/controller/BaseController.java
@@ -94,4 +94,12 @@
        return loginUserInfoVO;
    }
    public static void main(String[] args) {
        byte[] bytes = AES.parseHexStr2Byte("A5050B4D17DE52A39ECB57C6B160B8285ED8371239D8A6EBB0D2421B8BB6EA12C580D19459D29B97A31F07C8932D275F61F9F440A2A13FA718539CD06190F82036FE692BDE840784A66CD76E2C0360C25F9055DDB2FE33652B1D126B7720280ACC5471B0EF6BD00CFB478A06E1E78CDD6C310C1DE271BDE5348D6899063ADCDD39DE446236809801A14BF47B5468B96128E45DEFCE8365B83D62AA5C3C1570EA16CC51BC228421FFD731016943D7CEEAD36AD8FA055BE628639CE265F524562F99129823989A8D7B8A9B1B202524672E85464E15EB7E6F50C632C085B5602AD4B42E6D645499C5922D3714B6A987E44DA78059D87D5942F9FEFBB1B610C920F89AB76FC32D4C9E945DCDCE2974539BF928B0A2663954849459F8D127D2B50D7BFD5CF2B506785FB515CB9AB106FA9A40F467E75B5148ACE7A8C5E6650E6A3576396F3D08D6D1B90DB0F4CCDE8D4025B86E45CC32CCBB32CC93E2F248DBD9416D957A0C6E0FD4E35DAE29D2E7C1F6EE6213B6BB566159CF248D14680C4F84C051A754D0F1BE100C715030AC4585327D95743DF8B866817E4F7E59868FCEC8AFEB9C4A75C06FC21590E3A46419D7F75CB8A4DD280FF1D138D1E61E3EDE2C41737D0BA21A739C0A5BF8842479F00D4A8919");
        byte[] decrypt = AES.decrypt(bytes, Constants.AES_KEY);
        System.out.println(decrypt);
        String s = new String(decrypt);
        System.out.println(s);
    }
}
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/utlis/AES.java
@@ -63,8 +63,11 @@
     */
    public static byte[] decrypt(byte[] content, String password) {
        try {
            String charset = "utf-8";
            KeyGenerator kgen = KeyGenerator.getInstance("AES");
            kgen.init(128, new SecureRandom(password.getBytes()));
            SecureRandom secureRandom = SecureRandom.getInstance("SHA1PRNG") ;
            secureRandom.setSeed(password.getBytes(charset));
            kgen.init(128, secureRandom);
            SecretKey secretKey = kgen.generateKey();
            byte[] enCodeFormat = secretKey.getEncoded();
            SecretKeySpec key = new SecretKeySpec(enCodeFormat, "AES");
@@ -80,7 +83,7 @@
            e.printStackTrace();
        } catch (IllegalBlockSizeException e) {
            e.printStackTrace();
        } catch (BadPaddingException e) {
        } catch (BadPaddingException | UnsupportedEncodingException e) {
            e.printStackTrace();
        }
        return null;
springcloud_k8s_panzhihuazhihuishequ/common/target/classes/com/panzhihua/common/controller/BaseController.class
Binary files differ
springcloud_k8s_panzhihuazhihuishequ/common/target/classes/com/panzhihua/common/utlis/AES.class
Binary files differ