亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? encryption.java~140~

?? 用JAVA編寫的用密碼學中DES算法加密解密文件的程序
?? JAVA~140~
?? 第 1 頁 / 共 2 頁
字號:
    for(int i=0; i<16; i++)    {      passIP+=textInBi.charAt(IP[i]-1);    }    System.out.println("****************************passIP is "+passIP);    g1=passIP.substring(0,8);    g2=passIP.substring(8,16);    //first pass F and combine    passF=functionF(g1,subkey1);    System.out.println("**********************pass function F1 is "+passF);    passCombine1=combine(passF,g2);    System.out.println("*************************passCombine1 is "+passCombine1);    //second pass F and combine    passF=functionF(passCombine1,subkey2);    System.out.println("****************************pass function F2 is "+passF);    passCombine2=combine(passF,g1);    System.out.println("******************************passCombine2 is "+passCombine2);    //concate two subString with 8 bits    beforeIP_1=passCombine1+passCombine2;    System.out.println("the length of before IP-1 is "+beforeIP_1.length());    for(int i=0; i<16; i++)    {      passIP_1+=beforeIP_1.charAt(IP_1[i]-1);    }    System.out.println("passIP_1 is"+passIP_1);    subEncry=biToText(passIP_1);    return subEncry;  }  public String biToText(String bi)  {    String text="";    String subBi="";    int biToD=0;    System.out.println("bi is "+bi+" the length is "+bi.length());    for(int i=0; i<bi.length();i++)    {      subBi=bi.substring(i,i+8);      System.out.println("subString "+i+" is "+subBi);      i+=7;      biToD=Integer.parseInt(convertBToD(subBi));      System.out.println("decimal "+i+" is"+biToD);      text+=(char)biToD;      System.out.println("subtext is "+text);    }    return text;  }  public String textToBi(String subText)  {    String bi="";    String sub1="";    String sub2="";    int c1=subText.charAt(0);    int c2=subText.charAt(1);    sub1=convertDToB(c1,8);    System.out.println("sub1 is "+sub1);    sub2=convertDToB(c2,8);    bi=sub1+sub2;    System.out.println("&&&&&&&&&&&&&&&&&&&&&&&key is "+bi);    return bi;  }  public String functionF(String R, String subkey)  {    String E="812345456781";    String P="64735182";    String passE="";    String passCombine="";    String passSBox1="";    String passSBox2="";    String passSBox="";    String passP="";    //R pass E    for(int i=0; i<12; i++)    {      passE+=R.charAt(Integer.parseInt(E.substring(i,i+1))-1);    }    //E pass combination    passCombine+=combine(passE, subkey);    //get two substirng with 6 digits    String beforeSBox1=passCombine.substring(0,6);    String beforeSBox2=passCombine.substring(6,12);    //get two substring with 4 digits    passSBox1=passSBox(1,beforeSBox1);    passSBox2=passSBox(2,beforeSBox2);    //print out combine    System.out.println("box1 is ");    for(int i=0; i<passSBox1.length();i++)    {      System.out.print(passSBox1.charAt(i));    }    //print out combine    System.out.println("SBox2 is ");    for(int i=0; i<passSBox2.length();i++)    {      System.out.print(passSBox2.charAt(i));    }    //concate two substring into one    passSBox=passSBox1+passSBox2;    //pass P    for(int i=0; i<passSBox.length(); i++)    {      passP+=passSBox.charAt(Integer.parseInt(P.substring(i,i+1))-1);    }    return passP;  }  public String combine(String G1, String G2)  {    String combine="";    if(G1.length()==G2.length())    {      for(int i=0; i<G1.length(); i++)      {        combine+=XOR(G1.charAt(i),G2.charAt(i));      }    }    return combine;  }  public char XOR(char a, char b)  {    char c;    if(a==b)        c='0';    else        c='1';    return c;  }  //subString with 6 bits to pass box to get a string with 4 digits  public String passSBox(int box, String beforeBox)  {    String afterBox="";    //get row number in binary    String row=beforeBox.substring(0,1);    row+=beforeBox.charAt(5);    //get colum number in binary    String colum="";    for(int i=1; i<=4;i++)    {      colum+=beforeBox.charAt(i);    }    //convert binary to decimal to get row and colum in s-box    String inBoxRow=convertBToD(row);    String inBoxColum=convertBToD(colum);    int iRow=Integer.parseInt(inBoxRow);    int iColum=Integer.parseInt(inBoxColum);    afterBox=inSBox(box,iRow,iColum);    return afterBox;  }  //convert binary to decimal  public String convertBToD(String a)  {    int ctr=1, decimal=0;    for (int i = a.length()-1; i>=0; i--)    {      if(a.charAt(i)=='1')        decimal+=ctr;      ctr*=2;    }    String converted = "" + decimal;    return converted;  }  //find the number in S-Box  public String inSBox(int box, int row, int colum)  {    int boxNum=0;    String bin;    int[][] SBox1=    {      {14, 4, 13,  1,  2, 15, 11,  8,  3, 10,  6, 12,  5,  9,  0,  7},      {0, 15,  7,  4, 14,  2, 13,  1, 10,  6, 12, 11,  9,  5,  3,  8},      {4,  1, 14,  8, 13,  6,  2, 11, 15, 12,  9,  7,  3, 10,  5,  0},      {15, 12, 8,  2,  4,  9,  1,  7,  5, 11,  3, 14, 10,  0,  6, 13},    };    int[][] SBox2=    {      {15, 1,  8, 14,  6, 11,  3,  4,  9,  7,  2, 13, 12,  0,  5, 10},      {3, 13,  4,  7, 15,  2,  8, 14, 12,  0,  1, 10,  6,  9, 11,  5},      {0, 14,  7, 11, 10,  4, 13,  1,  5,  8, 12,  6,  9,  3,  2, 15},      {13,  8, 10,  1,  3, 15,  4,  2, 11,  6,  7, 12,  0,  5, 14, 9},    };    if(box==1)      boxNum=SBox1[row][colum];    if(box==2)      boxNum=SBox2[row][colum];    //get binary with 4 digits in string from s-box    bin=convertDToB(boxNum,4);    return bin;  }  //convert decimal number into binary in String  public String convertDToB (int deci,int bits)  {    String bi="";    //convert decimal into binary    while (deci>=1)    {      if(deci%2==0)        bi+="0";      if(deci%2==1)        bi+="1";      deci/=2;    }    if(bits==4)    {      //let String bi has four digits      while (bi.length() != 4)      {        bi += "0";      }    }    if(bits==8)     {       //let String bi has four digits       while (bi.length() != 8)       {         bi += "0";       }     }    bi=inverse(bi);    return bi;  }//inverse binary order  public String inverse(String oldS)  {    String newS="";    for(int i=oldS.length()-1; i>=0; i--)    {      newS+=oldS.charAt(i);    }    return newS;  }  //calculate two subkeys  public  String[] calSubKey(String Key) {   String[] subKey = new String[2];  //PC1 condition  int[] PC1 = {11,15,4,13,7,9,3,               2,5,14,6,10,12,1};  int[] PC2 = {6,11,4,8,13,3,               12,5,1,10,2,9};  //the key After PC1  String passKey1= "";  //the subKey1 and subKey2  String subKey1 = "";  String subKey2 = "";  //the result of key after PC1  for(int i=0;i<PC1.length;i++)  {    passKey1 += Key.charAt(PC1[i]-1);  }  //Divide the result into left bits(cKey) and right bits(dKey)  String cKey = passKey1.substring(0,7);  String dKey = passKey1.substring(7);  //Calculate subKey1-------------------------------  //Shift to the right at 2 positions for both c and d  String c1Key = cKey.substring(5)+cKey.substring(0,5);  String d1Key = dKey.substring(5)+dKey.substring(0,5);  //combine c1 and d1  String tempKey1 = "";  tempKey1 = c1Key + d1Key;  //after PC2,get K1  for(int i=0;i<PC2.length;i++)  {    subKey1+=tempKey1.charAt(PC2[i]-1);  }  //Calculate subKey2----------------------------------  //Shift to the right at 2 positions for both c1 and d1  String c2Key = c1Key.substring(5)+c1Key.substring(0,5);  String d2Key = d1Key.substring(5)+d1Key.substring(0,5);  //combine c2 and d2  String tempKey2 = "";  tempKey2 = c2Key + d2Key;  //pass PC2 , get k2  for(int i=0;i<PC2.length;i++)  {    subKey2+=tempKey2.charAt(PC2[i]-1);  }  subKey[0] = subKey1;  subKey[1] = subKey2;  return subKey; }}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久欧美中文字幕| 欧美精品第一页| 国产精品污www在线观看| 国产成人av福利| 中文字幕一区在线观看视频| 94色蜜桃网一区二区三区| 亚洲天堂av一区| 精品视频一区二区三区免费| 亚洲成人精品一区二区| 日韩丝袜美女视频| 福利一区二区在线| 亚洲欧洲日韩女同| 欧美日韩国产另类不卡| 蜜臀av亚洲一区中文字幕| 久久婷婷国产综合精品青草| 成人性生交大片免费看视频在线| 亚洲欧美在线另类| 精品视频999| 国产麻豆成人精品| 一区二区三区免费看视频| 日韩欧美精品在线视频| 国产91在线看| 午夜影院久久久| 国产亚洲欧美激情| 欧美日韩一区视频| 国产成人av电影在线| 亚洲第四色夜色| 中文字幕欧美激情一区| 欧美日韩精品二区第二页| 国产电影精品久久禁18| 亚洲国产成人av网| 国产精品拍天天在线| 欧美日韩一区在线观看| 成人激情动漫在线观看| 日韩av一区二区三区四区| 国产日韩精品一区二区浪潮av| 欧美性大战久久久久久久| 精品亚洲免费视频| 亚洲一区在线播放| 久久伊人蜜桃av一区二区| 在线视频一区二区三| 国产成人免费xxxxxxxx| 青草av.久久免费一区| 亚洲美女精品一区| 国产色婷婷亚洲99精品小说| 欧美日韩亚洲综合在线| 波多野结衣中文字幕一区二区三区 | 性做久久久久久久免费看| 精品成人佐山爱一区二区| 欧洲日韩一区二区三区| 岛国精品在线播放| 精品一区二区日韩| 免费一级片91| 日本亚洲一区二区| 一区二区三区免费网站| 中文字幕一区二区三区在线观看 | 国产精品一区二区无线| 日韩电影在线观看一区| 亚洲国产精品精华液网站| 亚洲欧美综合色| 国产精品久久久久四虎| 久久久精品综合| 精品国产亚洲一区二区三区在线观看| 欧美三级电影在线观看| 欧美性生活大片视频| 色偷偷久久一区二区三区| 99久久婷婷国产精品综合| 国产福利不卡视频| 精品一区二区三区日韩| 久久不见久久见免费视频7| 日本不卡一二三区黄网| 日本一道高清亚洲日美韩| 丝袜美腿一区二区三区| 午夜成人在线视频| 亚洲高清免费视频| 天天操天天色综合| 日韩二区三区在线观看| 日韩影院在线观看| 久久66热re国产| 狠狠色狠狠色综合系列| 精品亚洲porn| 国产精品69毛片高清亚洲| 国产69精品久久99不卡| 国产91综合一区在线观看| 成人午夜激情片| 91一区二区在线| 欧美亚洲另类激情小说| 欧美日韩久久一区| 在线播放中文一区| 91精品国产综合久久久久久久久久| 国产午夜精品在线观看| 国产免费成人在线视频| 亚洲欧美经典视频| 一区二区三区在线免费视频| 亚洲综合丁香婷婷六月香| 亚洲精品水蜜桃| 视频在线在亚洲| 精品一区二区免费视频| 高清在线不卡av| 91麻豆国产福利在线观看| 欧美午夜寂寞影院| 精品国产凹凸成av人导航| 国产欧美一区二区在线观看| 亚洲欧美日韩国产另类专区| 亚洲二区在线视频| 国产在线精品免费| 99综合影院在线| 在线电影一区二区三区| 国产丝袜欧美中文另类| 亚洲在线中文字幕| 国产乱一区二区| 欧洲一区在线观看| 2020国产精品自拍| 一区二区三区不卡在线观看| 麻豆国产精品官网| 99久久精品免费看| 日韩欧美一区二区免费| 国产精品亲子乱子伦xxxx裸| 日韩精品三区四区| 北条麻妃一区二区三区| 91精品视频网| 成人欧美一区二区三区白人 | 日韩无一区二区| 亚洲图片激情小说| 激情综合一区二区三区| 菠萝蜜视频在线观看一区| 日韩三级电影网址| 亚洲综合免费观看高清在线观看| 国产一区二区三区免费观看| 欧美色图12p| 国产精品久久久久久久浪潮网站| 亚洲成人自拍偷拍| 成人高清免费观看| 日韩精品中文字幕在线不卡尤物| 亚洲免费色视频| 国产精品自在在线| 欧美一区欧美二区| 亚洲品质自拍视频网站| 国产精品一区在线观看你懂的| 欧美系列亚洲系列| 亚洲免费在线视频一区 二区| 91麻豆精品国产91久久久久| 国产精品久久久一本精品| 久久不见久久见中文字幕免费| 欧美日韩精品一区二区三区| 中文字幕一区在线| 成人黄色av电影| 欧美韩国日本不卡| 国产盗摄一区二区三区| 欧美精品一区二区三区蜜桃视频| 亚洲福利一区二区| 在线观看av不卡| 亚洲一区二区在线免费看| 91免费看`日韩一区二区| 中文字幕欧美区| 国产91色综合久久免费分享| 亚洲精品一区二区三区影院| 视频在线观看国产精品| 欧美日本韩国一区二区三区视频| 亚洲激情成人在线| 在线观看一区日韩| 香蕉久久一区二区不卡无毒影院| 在线亚洲+欧美+日本专区| 一区二区三区四区蜜桃| 99国产精品99久久久久久| 国产精品色婷婷久久58| 国产一区二区三区日韩| 久久久久久97三级| 国产69精品久久久久毛片| 中文字幕av资源一区| 成人av网站免费| 亚洲精品视频在线观看免费| 色悠久久久久综合欧美99| 一区在线观看免费| 91猫先生在线| 亚洲成人手机在线| 制服丝袜亚洲色图| 韩国一区二区在线观看| 久久中文娱乐网| 成人免费视频播放| 亚洲蜜臀av乱码久久精品| 在线观看亚洲精品视频| 五月天丁香久久| 精品对白一区国产伦| 福利一区在线观看| 亚洲综合成人在线视频| 日韩亚洲欧美一区| 国产精品1区2区| 亚洲精品福利视频网站| 欧美精品在线观看播放| 久久国产精品第一页| 国产午夜亚洲精品羞羞网站| 99久久精品国产毛片| 性做久久久久久免费观看| 26uuu国产日韩综合| 91亚洲精品乱码久久久久久蜜桃| 亚洲成人7777| 国产日韩欧美制服另类| 日本韩国欧美在线| 美腿丝袜亚洲三区|