導航:首頁 > 源碼編譯 > 可逆演算法

可逆演算法

發布時間:2022-01-29 21:40:01

A. 不可逆加密演算法的壞處 為什麼需要可逆演算法來加密

比如說再做介面的時候 訪問介面需要帶參數但是明文不安全 如果用不可逆的加密在參數傳到介面後無法解密也就無法得知參數內容介面就無法使用 所以在做介面的參數傳遞的時候加密參數必須要用可逆也就是可解密的方式去做 目前可逆的加密一般都是非對稱的加密方式比如RSA

B. 可逆的加密演算法有啥

RAS公鑰演算法

C. 求一個用java編寫的可逆的加密演算法程序,自己寫的小程序也行。

public class mySecurity {
private static KeyGenerator keygen ;
private static SecretKey secretKey;
private static Cipher cipher;
private static mySecurity security = null;

private mySecurity(){
}
public static mySecurity getInstance() throws Exception{
if(security == null){
security = new mySecurity();
keygen = KeyGenerator.getInstance("AES");
secretKey = keygen.generateKey();
cipher =Cipher.getInstance("AES");
}
return security;
}

//加密
public String encrypt(String str) throws Exception{
cipher.init(Cipher.ENCRYPT_MODE,secretKey);

byte [] src = str.getBytes(); byte [] enc = cipher.doFinal(src);
return parseByte2HexStr(enc); }
//解密
public String decrypt(String str) throws Exception{
cipher.init(Cipher.DECRYPT_MODE,secretKey);

byte[] enc = parseHexStr2Byte(str); byte [] dec = cipher.doFinal(enc);
return new String(dec); }
/**將16進制轉換為二進制
* @param hexStr
* @return
*/
public static byte[] parseHexStr2Byte(String hexStr) {
if (hexStr.length() < 1)
return null;
byte[] result = new byte[hexStr.length()/2];
for (int i = 0;i< hexStr.length()/2; i++) {
int high = Integer.parseInt(hexStr.substring(i*2, i*2+1), 16);
int low = Integer.parseInt(hexStr.substring(i*2+1, i*2+2), 16);
result[i] = (byte) (high * 16 + low);
}
return result;
}

/**將二進制轉換成16進制
* @param buf
* @return
*/
public static String parseByte2HexStr(byte buf[]) {
StringBuffer sb = new StringBuffer();
for (int i = 0; i < buf.length; i++) {
String hex = Integer.toHexString(buf[i] & 0xFF);
if (hex.length() == 1) {
hex = '0' + hex;
}
sb.append(hex.toUpperCase());
}
return sb.toString();
}

public static void main(String[] args) throws Exception{
String str = "abc haha 我";
String ss = mySecurity.getInstance().encrypt(str) ;
System.out.println(ss);
System.out.println(mySecurity.getInstance().decrypt(ss));

}
}

D. 可逆矩陣的計算公式

計算公式:A^(-1)=(︱A︱)^(-1) A﹡(方陣A的行列式的倒數乘以A的伴隨矩陣)。

這個公式在矩陣A的階數很低的時候(比如不超過4階)效率還是比較高的,但是對於階數非常高的矩陣,通常我們通過對2n*n階矩陣[A In]進行行初等變換,變換成矩陣[In B],於是B就是A的逆矩陣。

矩陣的乘法滿足以下運算律:

結合律:的行向量(或列向量)線性無關。

假設M是一個m×n階矩陣,其中的元素全部屬於域K,也就是實數域或復數域。如此則存在一個分解,其中U是m×m階酉矩陣;Σ是m×n階實數對角矩陣;而V*,即V的共軛轉置,是n×n階酉矩陣。

這樣的分解就稱作M的奇異值分解 。Σ對角線上的元素Σi,i即為M的奇異值。常見的做法是將奇異值由大而小排列。如此Σ便能由M唯一確定了。

E. 網路上可逆、加密、壓縮、演算法一般有哪些

無損壓縮有:LZ77,LZ78,LZW, FLAC, WavPack, Monkey's Audio, PNG, Tiff
有損的有:mp3, mpeg1/2/4, h.264, h.265, avi, rm,

閱讀全文

與可逆演算法相關的資料

熱點內容
阿里雲掃碼登錄伺服器 瀏覽:970
化學基礎pdf 瀏覽:896
51單片機晶碼管 瀏覽:281
怎麼查伺服器假死原因日誌在哪看 瀏覽:277
掃描pdf文件 瀏覽:926
解壓密碼百度雲在線解壓 瀏覽:767
傳播學演算法推薦 瀏覽:749
我的世界網路游戲如何查找伺服器 瀏覽:257
安卓和蘋果通訊錄怎麼互傳 瀏覽:203
怎麼打開隱私與應用加密的菜單 瀏覽:416
我的世界伺服器小游戲的地址大全 瀏覽:578
在網路安全中加密安全機制提供了數據的 瀏覽:249
南京前端程序員私活怎麼收費 瀏覽:981
拓撲pdf 瀏覽:440
如何在工行app查我的訂單 瀏覽:214
車壓縮機改電動 瀏覽:83
如何尋找音樂app 瀏覽:831
一加加密的照片 瀏覽:200
阿里雲虛擬主機php 瀏覽:639
不卡點的解壓視頻 瀏覽:391