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

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

?? mct.java

?? Serpent算法及vb實現 畢業設計是做的 希望對大家有幫助
?? JAVA
?? 第 1 頁 / 共 2 頁
字號:
// $Id: $//// $Log: $// Revision 1.0  1998/04/06  raif// + original version based on cryptix.tools.MCT.//// $Endlog$/* * Copyright (c) 1998 Systemics Ltd on behalf of * the Cryptix Development Team. All rights reserved. */package NIST;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 Monte Carlo Tests data for both Encryption * and Decryption in Electronic Codebook (ECB) and Cipher Block Chaining * (CBC) modes.<p> * * MCT's output file format is in conformance with the layout described in * Section 4 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 MCT{// main method//...........................................................................        public static void main (String[] args) {        System.out.println(            "NIST Monte-Carlo 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");        MCT cmd = new MCT();        cmd.processOptions(args);        cmd.run();    }// Constants and variables//...........................................................................    static final String VERSION = "$Revision: 1.0$";    static final String SUBMITTER = "<as stated on the submission cover sheet>";    private static final char[] HEX_DIGITS = {        '0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F'    };    /** Current values of switches as set from the command line arguments. */    boolean ecb = false ;        // -e  generate ECB Encrypt/Decrypt only    boolean cbc = false ;        // -c  generate CBC Encrypt/Decrypt only    boolean encrypting = false ; // -E  generate Encrypt data only    boolean decrypting = false ; // -D  generate Decrypt data only    String dirName = null;       // -d  destination directory if != user.dir    String keylengths = null;    // -l  comma-separated key lengths    String cipherName = null;    // cipher algorithm name == package    File destination = null;     // destination directory File object    int[] keys = new int[] {128, 192, 256}; // key-length values to test with    final String eeFileName = "ecb_e_m.txt"; // ECB/Encrypt output filename    final String edFileName = "ecb_d_m.txt"; // ECB/Decrypt output filename    final String ceFileName = "cbc_e_m.txt"; // CBC/Encrypt output filename    final String cdFileName = "cbc_d_m.txt"; // CBC/Decrypt output filename    // will use zeroes for fields that require initial values.    // could be replaced by random.nextBytes() using    ////    static final java.util.Random rand = new java.util.Random();    //    // or for cryptographically strong randoms use the following    ////    static final java.security.SecureRandom rand = new java.security.SecureRandom();    //    // bear in mind that initialising the latter PRNG is a lengthy process    // 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. */    void processOptions (String[] args) {        int argc = args.length;        if (argc == 0) printUsage();        System.out.println(            "(type \"java NIST.MCT\" 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("-e")) {              // ECB mode only                ecb = true;                cbc = false;                next = (cmd.length() == 2);            } else if (cmd.startsWith("-c")) {       // CBC mode only                ecb = false;                cbc = true;                next = (cmd.length() == 2);            } else if (cmd.startsWith("-E")) {       // Encrypt cases only                encrypting = true;                decrypting = false;                next = (cmd.length() == 2);            } else if (cmd.startsWith("-D")) {       // Decrypt cases only                encrypting = false;                decrypting = true;                next = (cmd.length() == 2);            } else 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 (!ecb && !cbc)            ecb = cbc = true;        if (!encrypting && !decrypting)            encrypting = decrypting = true;        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 Basic API 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("MCT: "+s+"..."); }        /** write help text and quit. */    void printUsage() {        System.out.println(        "NAME\n" +        "  MCT: A Monte Carlo Tests data generator/exerciser for any AES\n" +        "  candidate cipher algorithm.\n\n" +        "SYNTAX\n" +        "  java NIST.MCT\n" +        "    [ -e | -c ]\n" +        "    [ -E | -D ]\n" +        "    [ -l <comma-separated-key-lengths>]\n" +        "    [ -d <output-directory>]\n" +        "    <cipher>\n\n" +        "DESCRIPTION\n" +        "  For a designated candidate AES block cipher algorithm, this command\n" +        "  generates and exercises Monte Carlo Tests data for both Encryption\n" +        "  and Decryption in Electronic Codebook (ECB) and Cipher Block Chaining\n" +        "  (CBC) modes.\n" +        "  MCT's output file format is in conformance with the layout described\n" +        "  in Section 4 of NIST's document \"Description of Known Answer Tests\n" +        "  and Monte Carlo Tests for Advanced Encryption Standard (AES) Candidate\n" +        "  Algorithm Submissions\" dated January 7, 1998.\n\n" +        "OPTIONS\n" +        "  -e   Generate test data for the cipher in ECB mode only.  By default\n"+        "       MCT generates both ECB and CBC test suites.\n\n" +        "  -c   Generate test data for the cipher in CBC mode only.  By default\n"+        "       MCT generates both ECB and CBC test suites.\n\n" +        "  -E   Generate Encryption data only for the cipher in one or both of\n"+        "       ECB and CBC modes depending on the first two switches.  By default\n"+        "       MCT generates both Encryption and Decryption data.\n\n" +        "  -D   Generate Decryption data only for the cipher in one or both of\n"+        "       ECB and CBC modes depending on the first two switches.  By default\n"+        "       MCT generates both Encryption and Decryption data.\n\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 the output files: \"ecb_e_m.txt\",\n" +        "       \"ecb_d_m.txt\", \"cbc_e_m.txt\" and \"cbc_d_m.txt\" will be generated.\n" +        "       If this destination directory is not specified, those files will\n" +        "       be placed in 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();        if (ecb) {            if (encrypting)                ecbEncrypt(eeFileName);            if (decrypting)                ecbDecrypt(edFileName);        }        if (cbc) {            if (encrypting)                cbcEncrypt(ceFileName);            if (decrypting)                cbcDecrypt(cdFileName);        }        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");    }// ECB MCT methods//...........................................................................    void ecbEncrypt (String encName) {        PrintWriter enc = null;        File f1 = new File(destination, encName);        try {            enc = new PrintWriter(new FileWriter(f1) , true);        } catch (IOException x) {            halt("Unable to initialize <" + encName + "> as a Writer:\n" +                x.getMessage());        }        enc.println();        enc.println("=========================");        enc.println();        enc.println("FILENAME:  \"" + encName+ "\"");        enc.println();        enc.println("Electronic Codebook (ECB) Mode - ENCRYPTION");        enc.println("Monte Carlo Test");        enc.println();        enc.println("Algorithm Name: " + cipherName);        enc.println("Principal Submitter: " + SUBMITTER);        enc.println();        try {            for (int k = 0; k < keys.length; k++)                ecbEncryptForKey(keys[k], enc);        } catch (Exception x) {            halt("Exception encountered in a " + cipherName +                "_Algorithm method:\n" + x.getMessage());        }        enc.println("==========");        enc.close();    }    void ecbDecrypt (String decName) {        PrintWriter dec = null;        File f2 = new File(destination, decName);        try {            dec = new PrintWriter(new FileWriter(f2) , true);        } catch (IOException x) {            halt("Unable to initialize <" + decName + "> as a Writer:\n" +                x.getMessage());        }        dec.println();        dec.println("=========================");        dec.println();        dec.println("FILENAME:  \"" + decName+ "\"");        dec.println();        dec.println("Electronic Codebook (ECB) Mode - DECRYPTION");

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美在线视频不卡| 色一情一乱一乱一91av| 亚洲va国产天堂va久久en| 国产精品久久久久三级| 国产精品日产欧美久久久久| 国产日韩欧美高清| 国产精品久久久久aaaa樱花| 国产精品理论在线观看| 专区另类欧美日韩| 亚洲一区二区影院| 日日欢夜夜爽一区| 久久精品国产99国产精品| 美女诱惑一区二区| 成人一级视频在线观看| 91网上在线视频| 欧美日韩一区二区三区在线| 欧美精品亚洲一区二区在线播放| 欧美精品亚洲二区| 久久久久国色av免费看影院| 日韩一区中文字幕| 午夜亚洲国产au精品一区二区| 日日夜夜精品视频天天综合网| 久色婷婷小香蕉久久| 国产精品一区二区视频| 91老师片黄在线观看| 欧美伦理影视网| 久久久蜜臀国产一区二区| 亚洲欧美一区二区三区国产精品| 午夜精品福利久久久| 国产一区二区精品在线观看| 一道本成人在线| 日韩欧美高清在线| 亚洲猫色日本管| 精品无人码麻豆乱码1区2区 | 国产一区二区三区香蕉| 色一区在线观看| 亚洲精品一线二线三线| 亚洲精选一二三| 国精品**一区二区三区在线蜜桃| 99热99精品| 欧美成人aa大片| 亚洲六月丁香色婷婷综合久久| 久久精品噜噜噜成人av农村| 91丨porny丨户外露出| 欧美一卡二卡三卡| 亚洲人成在线播放网站岛国| 国产在线一区二区综合免费视频| 在线视频观看一区| 国产精品丝袜在线| 久久精品国产秦先生| 欧美日韩在线一区二区| 国产精品网站在线观看| 久久激情五月激情| 91在线视频网址| 久久精品视频免费| 久久成人麻豆午夜电影| 欧美在线观看视频在线| 成人欧美一区二区三区| 欧美三级视频在线观看| 中文字幕va一区二区三区| 美腿丝袜一区二区三区| 欧美三级蜜桃2在线观看| 专区另类欧美日韩| 成人激情av网| 日本一区二区成人| 国产激情一区二区三区桃花岛亚洲| 欧美色手机在线观看| 亚洲精品成a人| 91在线观看免费视频| 欧美激情自拍偷拍| 国产a精品视频| 亚洲国产精品成人综合| 国产成人免费网站| 国产日韩欧美综合在线| 精品一区二区三区的国产在线播放| 欧美一区二区三区小说| 青青青伊人色综合久久| 日韩视频永久免费| 乱一区二区av| 久久久蜜桃精品| 高清不卡在线观看| 国产精品久久一卡二卡| 99精品偷自拍| 亚洲五月六月丁香激情| 欧美日韩国产高清一区二区三区| 午夜国产精品一区| 精品日韩av一区二区| 国产高清久久久| 一区在线中文字幕| 欧美亚洲日本国产| 人禽交欧美网站| 精品国产免费一区二区三区香蕉| 国产精品77777竹菊影视小说| 国产日韩欧美制服另类| 色一情一乱一乱一91av| 无吗不卡中文字幕| 精品国产伦一区二区三区观看方式| 久久www免费人成看片高清| 久久久久久一级片| 色婷婷综合久久久中文字幕| 午夜精品福利在线| 久久久不卡网国产精品一区| 91免费在线视频观看| 亚洲18女电影在线观看| 亚洲精品一区二区三区在线观看| 国产.精品.日韩.另类.中文.在线.播放| 国产精品乱人伦中文| 欧美人妇做爰xxxⅹ性高电影 | 国产iv一区二区三区| 亚洲精品国产精品乱码不99| 91麻豆精品国产91久久久久久久久| 久久精品免费观看| 一区二区视频在线| 精品噜噜噜噜久久久久久久久试看| 成人激情综合网站| 天天av天天翘天天综合网| 日本一区二区三区在线不卡| 欧美日精品一区视频| 国产99久久久久久免费看农村| 亚洲最新在线观看| 中文字幕第一区综合| 欧美精品xxxxbbbb| 99国产精品国产精品久久| 日韩成人一级大片| 一区二区在线观看免费| 久久久噜噜噜久噜久久综合| 欧美性videosxxxxx| 成人一区二区三区视频在线观看 | 久久综合视频网| 欧美性极品少妇| aaa国产一区| 国产一区在线精品| 日韩成人精品在线| 亚洲成人午夜电影| √…a在线天堂一区| 久久久久久久久久电影| 精品少妇一区二区三区免费观看| 色av一区二区| 91视频免费播放| 成人av免费在线| 国产精品中文字幕日韩精品| 奇米精品一区二区三区四区| 亚洲自拍与偷拍| 一区二区三区四区精品在线视频| 中文字幕欧美激情| 国产精品美女一区二区| 久久精品视频在线看| 久久精品在这里| 国产婷婷精品av在线| 久久精品在线免费观看| 久久精品在线观看| 国产午夜精品一区二区三区视频| 久久午夜国产精品| 国产日韩亚洲欧美综合| 国产欧美一区二区三区沐欲| 久久免费午夜影院| 中文一区一区三区高中清不卡| 国产欧美精品国产国产专区| 国产精品视频一二三区| 国产精品每日更新在线播放网址 | 欧美性色aⅴ视频一区日韩精品| 一本色道亚洲精品aⅴ| 色综合中文综合网| 亚洲国产精品v| 国产精品久久久久久久午夜片 | 欧美日韩不卡视频| 欧美久久久久免费| 日韩欧美自拍偷拍| 久久午夜色播影院免费高清| 国产嫩草影院久久久久| 国产精品不卡在线观看| 亚洲一区二区三区国产| 日韩av电影天堂| 国产一区二区看久久| 99久久精品免费看国产| 欧美日韩在线播放三区| 欧美成人艳星乳罩| 国产精品网曝门| 成人动漫精品一区二区| 在线观看亚洲专区| 日韩欧美国产精品| 国产精品欧美一区二区三区| 亚洲国产一区二区视频| 韩国视频一区二区| 在线观看中文字幕不卡| 欧美成人a在线| 一区二区三区四区高清精品免费观看| 日韩影视精彩在线| 国产宾馆实践打屁股91| 欧美综合一区二区三区| 久久综合久久综合久久综合| 亚洲日本成人在线观看| 久久电影网站中文字幕| 懂色中文一区二区在线播放| 欧美日韩小视频| 国产精品沙发午睡系列990531| 午夜精品一区二区三区免费视频| 国产成人精品www牛牛影视| 欧美性猛片aaaaaaa做受| 亚洲国产高清在线观看视频|