Giter Site home page Giter Site logo

security's Introduction

Security

/*

  • To change this license header, choose License Headers in Project Properties.
  • To change this template file, choose Tools | Templates
  • and open the template in the editor. */

package security12; import java.util.*; /** *

  • @author STUDENT */ public class Security12 {

    /**

    • @param args the command line arguments */ public static void main(String[] args) { // TODO code application logic here Scanner sc = new Scanner (System.in);

      //System.out.println(p); //key matrix declaration String[][] playfair = new String[5][5];

      //the user input and build of the matrix String key = sc.next();

      for (int i = 0; i < key.length(); i++){ for (int j = 0; j < key.length(); j++){ StringBuilder temp = new StringBuilder(); temp.append(key.charAt(i)); playfair[i][j] = temp.toString(); } }

      //completing the matrix for (int i = 0; i < 5; i++){ for(int j = 0; j < 5; j++){ if(playfair[i][j] == null && playfair[i][j].length() > 0){ playfair[i][j] = "a"; } } }

      //printing the matrix for (int i = 0; i < 5; i++){ for(int j = 0; j < 5; j++){ System.out.println(playfair[i][j]); } }

// //splitting the P // ArrayList split = new ArrayList(); //
// //Plain text input // String p = sc.nextLine(); // p = p.toLowerCase(); //
// int count = 0; // for (int j = 0; j < p.length()-1; j++){ // StringBuilder temp = new StringBuilder(); //// if((p.length() % 2 == 1) && (i == p.indexOf(p.charAt(p.length() - 1)))){ //// temp.append(p.charAt(i+1)); //// }else{ ////
//// } // temp.append(p.charAt(j)); // temp.append(p.charAt(j+1)); //
//
// if (count == 2){ // count = 0; // split.add(temp.toString()); // }else{ // count ++; // } //
// } // //
// for(int i = 0; i < split.size(); i++){ // System.out.println(split.get(i)); // } //
//// for(int i = 0; i < 5; i++){ //// for(int j = 0; j < 5; j++){ ////
//// } //// }

}

}

security's People

Contributors

xtcpanda avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.