PYTHON Crypto库支持RSA,私钥加密公钥解密(修改版)
PYTHON Crypto库支持RSA,私钥加密公钥解密,
文件名:RSA.PY 路径:Crypto\PublicKey\RSA.py
将此Crypto库中以上文件替换。
关于加解密方法看我的文章有写
C#-DES_SAME_JAVA-DES.zip
本代码是C#方法,通过开源C#BouncyCastle加密组件进行DES加解密。和JAVA DES加解密互通。JAVA方法如下:
public static String desEncrypt(String source, String desKey) throws Exception {
try {
// 从原始密匙数据创建DESKeySpec对象
SecretKeyFactory keyFactory = SecretKeyFactory.getInstance("DES");
SecretKey securekey = keyFactory.generateSecret(new DESKeySpec(desKey.getBytes()));
// Cipher对象实际完成加密操作
Cipher cipher = Cipher.getInstance("DES");
// 用密匙初始化Cipher对象
cipher.init(Cipher.ENCRYPT_MODE, securekey);
// 现在,获取数据并加密
byte[] destBytes = cipher.doFinal(source.getBytes());
StringBuilder hexRetSB = new StringBuilder();
for (byte b : destBytes) {
String hexString = Integer.toHexString(0x00ff & b);
hexRetSB.append(hexString.length() == 1 ? 0 : "").append(hexString);
}
return hexRetSB.toString();
} catch (Exception e) {
throw new Exception("DES加密发生错误", e);
}
}
public static String desDecrypt(String source, String desKey) throws Exception {
// 解密数据
byte[] sourceBytes = new byte[source.length() / 2];
for (int i = 0; i < sourceBytes.length; i++) {
sourceBytes[i] = (byte) Integer.parseInt(source.substring(i * 2, i * 2 + 2), 16);
}
try {
SecretKeyFactory keyFactory = SecretKeyFactory.getInstance("DES");
SecretKey securekey = keyFactory.generateSecret(new DESKeySpec(desKey.getBytes()));
Cipher cipher = Cipher.getInstance("DES");
// 用密匙初始化Cipher对象
cipher.init(Cipher.DECRYPT_MODE, securekey);
// 现在,获取数据并解密
byte[] destBytes = cipher.doFinal(sourceBytes);
return new String(destBytes);
} catch (Exception e) {
throw new Exception("DES解密发生错误", e);
}
}
ar28-11路由升级文件 R0311p19版本
最新版华为AR28_AR46-CMW340-R0311P19升级文件带QOS限速功能!
IBM_BIOS详细设置.doc
当开启T-series时,屏幕下方出现"Press F1 for IBM BIOS Setup Utility"时,同时按下F1,将会进入Bios设置界面。
再Bios设置界面中,Config、Date/time、Password、Startup、Restart分别为设置项,除了这些项目外,其他所显示的为本机的系统信息。首先介绍本机的系统信息。Bios Version 1.04c(1AET47WW) 这个是机身BIOS版本