Example usage for org.bouncycastle.crypto.engines Shacal2Engine Shacal2Engine

List of usage examples for org.bouncycastle.crypto.engines Shacal2Engine Shacal2Engine

Introduction

In this page you can find the example usage for org.bouncycastle.crypto.engines Shacal2Engine Shacal2Engine.

Prototype

public Shacal2Engine() 

Source Link

Usage

From source file:cologne.eck.peafactory.gui.Menu.java

License:Open Source License

@Override
public void actionPerformed(ActionEvent ape) {

    //JComponent source = (JComponent) ape.getSource();
    String command = ape.getActionCommand();

    //Menu/*  w  w w .ja  v a 2s. c om*/
    if (command.equals("newProject")) {
        ProjectSelection proj = new ProjectSelection();
        Point p = MainView.getFrameLocation();
        proj.setLocation((int) p.getX() + 100, (int) p.getY() + 60);
        proj.setVisible(true);
    } else if (command.equals("randomPassword")) {
        PasswordGeneratorDialog pg = new PasswordGeneratorDialog(PeaFactory.getFrame());
        pg.setVisible(true);
    } else if (command.equals("keyboard")) {
        int input = JOptionPane.showConfirmDialog(PeaFactory.getFrame(),
                languageBundle.getString("add_keyboard"), " ", JOptionPane.YES_NO_OPTION);
        if (input == 0) {
            FileModifier.setSetKeyboard(true);
        } else {
            FileModifier.setSetKeyboard(false);
        }
    } else if (command.equals("psw_generator")) {
        int input = JOptionPane.showConfirmDialog(PeaFactory.getFrame(),
                languageBundle.getString("add_psw_generator"), " ", JOptionPane.YES_NO_OPTION);
        if (input == 0) {
            FileModifier.setPswGenerator(true);
        } else {
            FileModifier.setPswGenerator(false);
        }
    } else if (command.equals("quit")) {
        System.exit(0);

    } else if (command.equals("generalPeaSettings")) {

        @SuppressWarnings("unused")
        GeneralPeaSettings imageSetting = new GeneralPeaSettings();

    } else if (command.equals("setThoughtless")) {
        securityLevel = 1;
        setSecurityLevel(1);
    } else if (command.equals("setLow")) {
        securityLevel = 2;
        setSecurityLevel(2);
    } else if (command.equals("setStandard")) {
        securityLevel = 3;
        setSecurityLevel(3);
    } else if (command.equals("setHigh")) {
        securityLevel = 4;
        setSecurityLevel(4);
    } else if (command.equals("setParanoid")) {
        securityLevel = 5;
        setSecurityLevel(5);

    } else if (command.equals("setBcrypt")) {
        setSecurityLevel(securityLevel);
        KeyDerivation.setKdf(new BcryptKDF());
    } else if (command.equals("setScrypt")) {
        setSecurityLevel(securityLevel);
        KeyDerivation.setKdf(new ScryptKDF());
    } else if (command.equals("setDragonfly")) {
        setSecurityLevel(securityLevel);
        CatenaKDF.setVersionID("Dragonfly-Full");
        KeyDerivation.setKdf(new CatenaKDF());
    } else if (command.equals("setButterfly")) {
        setSecurityLevel(securityLevel);
        CatenaKDF.setVersionID("Butterfly-Full");
        KeyDerivation.setKdf(new CatenaKDF());
    } else if (command.equals("setPomelo")) {
        setSecurityLevel(securityLevel);
        KeyDerivation.setKdf(new PomeloKDF());

    } else if (command.equals("setBcryptParameters")) {

        @SuppressWarnings("unused")
        BcryptSetting bcryptSetting = new BcryptSetting();

    } else if (command.equals("setPomeloParameters")) {

        @SuppressWarnings("unused")
        PomeloSetting pomeloSetting = new PomeloSetting();

    } else if (command.equals("setScryptParameters")) {

        @SuppressWarnings("unused")
        ScryptSetting scryptSetting = new ScryptSetting();

    } else if (command.equals("setCatenaParameters")) {

        @SuppressWarnings("unused")
        CatenaSetting catenaSetting = new CatenaSetting();

    } else if (command.equals("setImageParameters")) {

        @SuppressWarnings("unused")
        ImageSetting imageSetting = new ImageSetting();

    } else if (command.equals("setShacal2")) {
        CipherStuff.setCipherAlgo(new Shacal2Engine());
    } else if (command.equals("setThreefish256")) {
        CipherStuff.setCipherAlgo(new ThreefishEngine(256));
    } else if (command.equals("setThreefish512")) {
        CipherStuff.setCipherAlgo(new ThreefishEngine(512));
    } else if (command.equals("setThreefish1024")) {
        CipherStuff.setCipherAlgo(new ThreefishEngine(1024));
    } else if (command.equals("setTwofish")) {
        CipherStuff.setCipherAlgo(new TwofishEngine());
    } else if (command.equals("setSerpent")) {
        CipherStuff.setCipherAlgo(new SerpentEngine());
    } else if (command.equals("setAES")) {
        CipherStuff.setCipherAlgo(new AESEngine());
    } else if (command.equals("setAESFast")) {
        CipherStuff.setCipherAlgo(new AESFastEngine());

        // hash function:
    } else if (command.equals("setWhirlpool")) {
        HashStuff.setHashAlgo(new WhirlpoolDigest());
    } else if (command.equals("setKeccak")) {
        HashStuff.setHashAlgo(new SHA3Digest());
    } else if (command.equals("setSha512")) {
        HashStuff.setHashAlgo(new SHA512Digest());
    } else if (command.equals("setSha384")) {
        HashStuff.setHashAlgo(new SHA384Digest());
    } else if (command.equals("setSkein512")) {
        HashStuff.setHashAlgo(new SkeinDigest(512, 512));
    } else if (command.equals("setBlake512")) {
        HashStuff.setHashAlgo(new Blake2bDigest());
        //      } else if (command.equals("setRipemd256")) {
        //         HashStuff.setHashAlgo( new RIPEMD256Digest() );          
    } else if (command.equals("setRipemd320")) {
        HashStuff.setHashAlgo(new RIPEMD320Digest());

    } else if (command.equals("setDE")) {
        PeaFactory.setI18n("de");
    } else if (command.equals("setEN")) {
        PeaFactory.setI18n("en");

    } else if (command.equals("notes")) {
        @SuppressWarnings("unused")
        InfoDialog info = new InfoDialog(languageBundle.getString("notes_description"), null, "notes");
    } else if (command.equals("editor")) {
        @SuppressWarnings("unused")
        InfoDialog info = new InfoDialog(languageBundle.getString("editor_description"), null, "editor");
    } else if (command.equals("image")) {
        @SuppressWarnings("unused")
        InfoDialog info = new InfoDialog(languageBundle.getString("image_description"), null, "image");
    } else if (command.equals("keyboard_info")) {
        @SuppressWarnings("unused")
        InfoDialog info = new InfoDialog("Onscreen Keyboard", null, "keyboard");
    } else if (command.equals("file")) {
        @SuppressWarnings("unused")
        InfoDialog info = new InfoDialog(languageBundle.getString("file_description"), null, "file");

    } else if (command.equals("problemHelp")) {
        JOptionPane pane = new JOptionPane(languageBundle.getString("problem_help_dialog"),
                JOptionPane.PLAIN_MESSAGE, JOptionPane.OK_OPTION, null, null);//new ImageIcon(PswDialogView.getImage()), null);
        pane.setFont(new Font(Font.SANS_SERIF, Font.PLAIN, 12));
        //pane.setIconImage(PswDialogView.getImage());
        pane.setVisible(true);
        //pane.showMessageDialog(null, languageBundle.getString("problem_help_dialog"), null, JOptionPane.PLAIN_MESSAGE);
    } else if (command.equals("howToUse")) {
        JOptionPane.showMessageDialog(PeaFactory.getFrame(), languageBundle.getString("how_to_use_dialog"),
                null, JOptionPane.PLAIN_MESSAGE);
    } else if (command.equals("aboutLicense")) {
        JOptionPane.showMessageDialog(PeaFactory.getFrame(), languageBundle.getString("about_license_dialog"),
                null, JOptionPane.PLAIN_MESSAGE);
    }
}