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

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

?? gen_plains.java

?? Serpent算法及vb實現 畢業設計是做的 希望對大家有幫助
?? JAVA
字號:
// $Id: $//// $Log: $// Revision 1.0  1998/05/22  Eli Biham// + original version based on Cryptix NIST.KAT.//// $Endlog$/* Most of this code is: * Copyright (c) 1998 Systemics Ltd on behalf of * the Cryptix Development Team. All rights reserved. */package Serpent;import java.io.File;import java.io.FileWriter;import java.io.IOException;import java.io.PrintWriter;import java.lang.reflect.InvocationTargetException;import java.lang.reflect.Method;import java.util.StringTokenizer;/** * For a designated candidate AES block cipher algorithm, this command * generates and exercises tables tests.<p> * * file format is in conformance with the layout described in * Section 3 of NIST's document "Description of Known Answer Tests and Monte * Carlo Tests for Advanced Encryption Standard (AES) Candidate Algorithm * Submissions" dated January 7, 1998.<p> * * This code processes the user's request using NIST Basic API.<p> * * <b>Copyright</b> &copy; 1998 * <a href="http://www.systemics.com/">Systemics Ltd</a> on behalf of the * <a href="http://www.systemics.com/docs/cryptix/">Cryptix Development Team</a>. * <br>All rights reserved.<p> * * <b>$Revision: $</b> * @author  Raif S. Naffah */public final class gen_plains{// main method//...........................................................................        public static void main (String[] args) {        System.out.println(            "NIST tables (SB) Tests data generator/exerciser\n" +            VERSION + "\n" +            "Copyright (c) 1998 Systemics Ltd. on behalf of\n" +            "the Cryptix Development Team.  All rights reserved.\n\n");        gen_plains cmd = new gen_plains();        cmd.processOptions(args);        cmd.run();    }// Fields & constants//...........................................................................    static final String VERSION = "$Revision: 1.0$";    static final String SUBMITTER = "<as stated on the submission cover sheet>";    // current values of switches as set from the command line arguments    String dirName = null;    // -d  output directory if != user.dir    String keylengths = null; // -l  comma-separated key lengths    String cipherName = null; // cipher algorithm name, default == provider    File destination = null;  // destination directory File object    int[] keys = new int[] {128, 192, 256}; // key-length values to test with        final String FileName = "ecb_tbl.txt";    // statistics fields    long encBlocks; // total count of encrypted blocks    long decBlocks; // total count of decrypted blocks    long keyCount;  // total count of key creation requests    Method makeKey = null; // reference to makeKey([B)    Method encrypt = null; // reference to blockEncrypt([B, int, int)    Method decrypt = null; // reference to blockDecrypt([B, int, int)// Own methods//...........................................................................    /** Process command line arguments and initialise instance fields. */    private void processOptions (String[] args) {        int argc = args.length;        if (argc == 0)            printUsage();        System.out.println(            "(type \"java NIST.gen_plains\" with no arguments for help)\n\n");        int i = -1;        String cmd = "";        boolean next = true;        while (true) {            if (next) {                i++;                if (i >= argc)                    break;                else                    cmd = args[i];            } else                cmd = "-" + cmd.substring(2);                        if (cmd.startsWith("-l")) {       // key lengths                keylengths = args[i + 1];                i++;                next = true;            } else if (cmd.startsWith("-d")) {       // destination directory                dirName = args[i + 1];                i++;                next = true;            } else // it's the cipher                cipherName = cmd;        }        // sanity checks        if (cipherName == null)            halt("Missing cipher algorithm name");        if (cipherName.length() > 1 &&                (cipherName.startsWith("\"") || cipherName.startsWith("'")))            cipherName = cipherName.substring(2, cipherName.length() - 2);        if (keylengths != null) {            int count = 0;            int k;            int[] keystemp = new int[3]; // maximum allowed            StringTokenizer st = new StringTokenizer(keylengths, ", \t\"");            while (st.hasMoreTokens()) {                k = Integer.parseInt(st.nextToken());                if (k <= 0)                    halt("Negative key length not allowed: "+k);                if (count == 3)                    halt("Only three key-length values are allowed.");                keystemp[count++] = k;            }            if (count != 0) {                keys = new int[count];                System.arraycopy(keystemp, 0, keys, 0, count);            }        }        if (dirName == null)            dirName = System.getProperty("user.dir");        destination = new File(dirName);        if (! destination.isDirectory())            halt("Destination <" + destination.getName() +                "> is not a directory");        String aes = cipherName + "." + cipherName + "_Algorithm";        try {            Class algorithm = Class.forName(aes);            // inspect the _Algorithm class            Method[] methods = algorithm.getDeclaredMethods();            for (i = 0; i < methods.length; i++) {                String name = methods[i].getName();                int params = methods[i].getParameterTypes().length;                if (name.equals("makeKey") && (params == 1))                    makeKey = methods[i];                else if (name.equals("blockEncrypt") && (params == 3))                    encrypt = methods[i];                else if (name.equals("blockDecrypt") && (params == 3))                    decrypt = methods[i];            }            if (makeKey == null)                throw new NoSuchMethodException("makeKey()");            if (encrypt == null)                throw new NoSuchMethodException("blockEncrypt()");            if (decrypt == null)                throw new NoSuchMethodException("blockDecrypt()");        } catch (ClassNotFoundException x1) {            halt("Unable to find "+aes+" class");        } catch (NoSuchMethodException x2) {            halt("Unable to find "+aes+"."+x2.getMessage()+" method");        }    }    /**     * Print an error message to System.err and halts execution returning     * -1 to the JVM.     *     * @param s  A message to output on System.err     */    static void halt (String s) {        System.err.println("\n*** "+s+"...");        System.exit(-1);    }    /**     * Write a notification message to System.out.     *     * @param s  String to output to System.out.     */    static void notify (String s) { System.out.println("gen_plains: "+s+"..."); }        /** write help text and quit. */    void printUsage() {        System.out.println(        "NAME\n" +        "  gen_plains: tables (SB) Tests data generator/exerciser for Serpent.\n\n" +        "SYNTAX\n" +        "  java NIST.gen_plains\n" +        "    [ -l <comma-separated-key-lengths>]\n" +        "    [ -d <output-directory>]\n" +        "    <cipher>\n\n" +        "DESCRIPTION\n" +	" Generates plain texts for testing s boxes\n" +        "OPTIONS\n" +        "  -l <comma-separated-key-lengths>\n" +        "       Comma separated list (maximum of three) of key lengths to use\n" +        "       for the tests.  If omitted, the following three values are\n" +        "       assumed: 128, 192 and 256.\n\n" +        "  -d <output-directory>\n" +        "       Pathname of the directory where output files: \"ecb_tbl.txt\"\n" +        "       and \"ecb_tbl.txt\" will be generated.  If this destination\n" +        "       directory is not specified, those files will be placed in\n" +        "       the current user directory.\n\n" +        "  <cipher>\n" +        "       Cipher algorithm name.\n\n" +        "COPYRIGHT\n" +        "  Copyright (c) 1998 Systemics Ltd. on behalf of\n" +        "  the Cryptix Development Team.  All rights reserved.\n");        System.exit(0);    }    /** main action. */    void run() {        long time = System.currentTimeMillis();	gen_plains(FileName);        notify("Java interpreter used: Version "+System.getProperty("java.version"));        notify("Java Just-In-Time (JIT) compiler: "+System.getProperty("java.compiler"));        // print timing and stats info        notify("Total execution time (ms): "+(System.currentTimeMillis() - time));        notify("During this time, "+cipherName+":");        notify("  Encrypted "+encBlocks+" blocks");        notify("  Decrypted "+ decBlocks+" blocks");        notify("  Created "+keyCount+" session keys");    }// Variable Text gen_plains methods//...........................................................................    void gen_plains (String fileName) {        File f = new File(destination, fileName);        PrintWriter out = null;        try {            out = new PrintWriter(new FileWriter(f) , true);        } catch (IOException ex1) {            halt("Unable to initialize <" + fileName + "> as a Writer:\n" +                ex1.getMessage());        }        out.println();        out.println("=========================");        out.println();        out.println("FILENAME:  \"" + fileName + "\"");        out.println();        out.println("Electronic Codebook (ECB) Mode");        out.println("ECB tables (SB) Tests");        out.println();        out.println("Algorithm Name: " + cipherName);        out.println("Principal Submitter: " + SUBMITTER);        out.println();        try {            for (int k = 0; k < keys.length; k++)                forKey(keys[k], out);        } catch (Exception x) {            halt("Exception encountered in a " + cipherName +                "_Algorithm method:\n" + x.getMessage());        }        out.println("==========");        out.close();    }    void forKey (int keysize, PrintWriter out)    throws IllegalAccessException, InvocationTargetException {        notify("Generating and testing Variable Text gen_plains (short); key size: " +            keysize);        Object[] args = {};         //actual arguments        byte[] keyMaterial = new byte[keysize / 8];        byte[] pt = new byte[16];   // plaintext (16=default AES block size)        byte[] ct;                  // ciphertext        byte[] cpt;                 // computed plaintext        int round = 0;              // current round ord. number        args = new Object[] { keyMaterial };        Object skeys = makeKey.invoke(null, args); // the cipher's session keys	Object skeysP=skeys; // Initializing just to inhibit compiler warnings        try {	  skeysP = Serpent_Standard.makeKey(keyMaterial);        } catch (Exception x) {            halt("Exception encountered in a " + cipherName +                "_Algorithm method:\n" + x.getMessage());        }        keyCount++;        out.println("==========");        out.println();        out.println("KEYSIZE=" + keysize);        out.println();        out.println("KEY=" + toString(keyMaterial));        out.println();        args = new Object[3];        args[1] = new Integer(0);        args[2] = skeys;        for (int i = 0; i < 32; i++) {            for (int j = 0; j < 16; j++) {                round++;                out.println("I=" + round + " Round=" + i + " Input value=" + j);		int lll;		for(lll=0; lll<16; lll++)		  pt[lll] = 0;                pt = (byte[]) Serpent_Standard.blockDecryptGetP(i, j, 0, skeysP);                out.println("PT=" + toString(pt));                args[0] = pt;                ct = (byte[]) encrypt.invoke(null, args);                encBlocks++;                out.print("CT=" + toString(ct));                args[0] = ct;                cpt = (byte[]) decrypt.invoke(null, args);                decBlocks++;                if (! areEqual(pt, cpt))  // check if results match                    out.print(" *** ERROR ***");                out.println();                out.println();            }        }    }// utility static methods// (copied from cryptix.util.core ArrayUtil and Hex classes)//...........................................................................        /**     * Compares two byte arrays for equality.     *     * @return true if the arrays have identical contents     */    private static boolean areEqual (byte[] a, byte[] b) {        int aLength = a.length;        if (aLength != b.length)            return false;        for (int i = 0; i < aLength; i++)            if (a[i] != b[i])                return false;        return true;    }    private static final char[] HEX_DIGITS = {        '0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F'    };    /**     * Returns a string of hexadecimal digits from a byte array. Each     * byte is converted to 2 hex symbols.     */    private static String toString (byte[] ba) {        int length = ba.length;        char[] buf = new char[length * 2];        for (int i = length, j = 0, k; i > 0; ) {            k = ba[--i];            buf[j++] = HEX_DIGITS[(k >>> 4) & 0x0F];            buf[j++] = HEX_DIGITS[ k        & 0x0F];        }        return new String(buf);    }}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩一区二区不卡| 亚洲精品大片www| 中文av一区二区| 五月天中文字幕一区二区| 国产一区二区三区四区五区入口| 色一情一乱一乱一91av| ww亚洲ww在线观看国产| 亚洲电影欧美电影有声小说| 丁香婷婷综合网| 精品国产乱码久久久久久影片| 一区二区视频免费在线观看| 国产成人午夜视频| 日韩一级黄色大片| 亚洲午夜视频在线观看| 91啪亚洲精品| 欧美激情一区在线观看| 韩国精品一区二区| 5566中文字幕一区二区电影| 亚洲香蕉伊在人在线观| 91色婷婷久久久久合中文| 国产人成亚洲第一网站在线播放| 蜜臀精品久久久久久蜜臀| 欧美午夜精品电影| 伊人婷婷欧美激情| 97国产一区二区| 亚洲欧洲国产专区| 国产很黄免费观看久久| 久久久久久黄色| 黄色成人免费在线| 久久综合久久综合久久综合| 美女高潮久久久| 欧美zozo另类异族| 精品制服美女久久| 欧美成人精品二区三区99精品| 日本伊人午夜精品| 日韩一区二区电影在线| 久久不见久久见免费视频7| 日韩欧美久久一区| 激情欧美一区二区三区在线观看| 精品久久一区二区| 国产一区二区三区综合| 国产日产欧美一区二区视频| 国产成人在线电影| 中文字幕亚洲不卡| 91美女在线看| 亚洲大片在线观看| 欧美一级搡bbbb搡bbbb| 久久超碰97中文字幕| 久久久久久夜精品精品免费| 风间由美性色一区二区三区| 国产精品乱人伦| 欧美三级电影一区| 免费在线观看不卡| 国产女人18水真多18精品一级做| 99久免费精品视频在线观看| 亚洲欧美日韩国产另类专区| 欧美日韩精品一区二区三区 | 69av一区二区三区| 青草国产精品久久久久久| 日韩欧美高清在线| 成人中文字幕电影| 亚洲国产aⅴ天堂久久| 精品国产区一区| 99视频一区二区三区| 五月天亚洲婷婷| 久久久精品综合| 色综合久久66| 激情五月婷婷综合网| 亚洲免费三区一区二区| 欧美一级理论性理论a| 成人午夜碰碰视频| 日韩成人一区二区三区在线观看| 久久精品视频一区二区三区| 色婷婷av一区二区三区大白胸| 另类小说视频一区二区| 亚洲天堂免费在线观看视频| 日韩亚洲欧美在线观看| 91视频观看视频| 国产美女精品在线| 性感美女久久精品| 国产精品久久久久久久久免费樱桃| 欧美精选在线播放| 成人app在线观看| 久久精品噜噜噜成人88aⅴ| 综合久久久久久久| 久久久久久久久久久久久夜| 欧美日韩精品二区第二页| 国产91对白在线观看九色| 日韩电影在线看| 一区二区三区在线视频观看58| 久久久九九九九| 日韩三级免费观看| 欧美日韩一区二区三区不卡| 高清国产午夜精品久久久久久| 免费观看久久久4p| 亚洲一卡二卡三卡四卡| 亚洲欧美在线视频观看| 国产日韩一级二级三级| 26uuu久久综合| 日韩一区二区三区免费看| 欧美伊人久久大香线蕉综合69| 成人小视频在线| 国产精品一卡二卡在线观看| 日av在线不卡| 午夜精品久久久久久久蜜桃app| 亚洲色图清纯唯美| 国产精品成人免费在线| 欧美激情一区二区三区蜜桃视频| 精品99999| 精品国产污污免费网站入口| 日韩欧美一二三四区| 欧美巨大另类极品videosbest | 欧美日韩视频在线观看一区二区三区 | 国产午夜精品一区二区三区四区 | 国产欧美一区二区三区沐欲| 日韩美女主播在线视频一区二区三区| 欧美日韩久久一区| 欧美人妇做爰xxxⅹ性高电影| 欧美性猛片xxxx免费看久爱| 欧美体内she精高潮| 欧美视频在线一区二区三区 | 欧美xxxx在线观看| 欧美大胆一级视频| 久久综合资源网| 国产精品网站导航| ...中文天堂在线一区| 亚洲精品一二三四区| 一二三四区精品视频| 香蕉成人啪国产精品视频综合网| 天堂va蜜桃一区二区三区漫画版| 日韩和欧美一区二区三区| 琪琪久久久久日韩精品| 狠狠狠色丁香婷婷综合激情| 国产精品一区二区不卡| 91香蕉视频在线| 在线电影一区二区三区| 欧美成人午夜电影| 亚洲国产精品二十页| 亚洲精品福利视频网站| 天天综合日日夜夜精品| 国内成+人亚洲+欧美+综合在线| 成人一级片在线观看| 色狠狠一区二区| 日韩精品一区二区三区视频 | 日韩三区在线观看| 国产亚洲短视频| 一区二区视频在线| 蜜臀精品一区二区三区在线观看| 国产**成人网毛片九色| 91精品91久久久中77777| 日韩欧美国产一二三区| 国产精品卡一卡二卡三| 日韩国产在线观看一区| 国产成人av电影在线观看| 日本道精品一区二区三区| 日韩欧美视频一区| 亚洲麻豆国产自偷在线| 国内精品免费在线观看| 欧美性欧美巨大黑白大战| 久久久久久久免费视频了| 亚洲国产日韩一级| 国产剧情av麻豆香蕉精品| 欧美在线短视频| 亚洲国产精品传媒在线观看| 午夜久久电影网| av动漫一区二区| 久久天天做天天爱综合色| 亚洲影院久久精品| 粉嫩嫩av羞羞动漫久久久| 91精品国产免费久久综合| 亚洲视频在线一区二区| 国产一区二区三区久久悠悠色av| 91福利国产精品| 国产精品亲子乱子伦xxxx裸| 狠狠色丁香久久婷婷综合_中| 欧美性大战久久久久久久蜜臀| 国产精品色哟哟| 国产在线乱码一区二区三区| 这里只有精品免费| 一区二区三区欧美日| 成人av中文字幕| 国产三级精品三级在线专区| 蜜桃久久av一区| 91精品国产综合久久久久久漫画| 亚洲自拍偷拍欧美| av电影在线观看一区| 欧美极品美女视频| 国产福利精品导航| 久久久久亚洲蜜桃| 久久99精品一区二区三区| 91精品国产色综合久久ai换脸 | 欧美日韩欧美一区二区| 亚洲女爱视频在线| 97久久精品人人澡人人爽| 国产精品高潮呻吟久久| www..com久久爱| 亚洲欧洲国产日韩| 99久久综合精品| 亚洲摸摸操操av| 在线精品视频免费播放|