الفريق العربي للبرمجةأرشيف المنتديات · 2000 – 2023
نسخة أرشيفية للقراءة فقط — التسجيل والمشاركة مغلقان، والمحتوى محفوظ كما كان.

Cryptography project

مغلق
بدأه reem elsaba في 4 يناير 2011 · 7 رد · 903 مشاهدة · في JavaSE
مشاركة: واتساب X فيسبوك تيليجرام
#1 صاحب الموضوع

السلام عليكم

ياريت اي حد بيفهم بالجافا كثير منيح يساعدني بهالمشروع لان عليي بحث تخرج ومشروع تخرج بالـ Expert System ومش ملحقة اعمل المشروع و المشروع اليوم الساعة 9المسا اخر موعد لتسليمه

والمشروع مطلوب عمل تشفير لملف موجود عندي عالـ جهاز و مطلوب مننا عمل تشفير 4 خوارزميات للتشفير عالأقل

والنت بينز عندي ضرب بعد مشروع الويب سيرفيس وطبعا الشغلة بدها فرمتة للجهاز و لكن يوم الخميس عندي اول امتحان ومافيني فرمت الجهاز

بقى ساعدوني الله يكرمكم

وهون في رابط لصورة الواجهة للـ المشروع

545992108.jpg

و قمت بعمل بعض الخوارزميات لـ RSA

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */


import java.math.BigInteger ;
import java.util.Random ;


public class RSA
{
    BigInteger one = new BigInteger("1") ;
    Random random = new Random() ;
    static BigInteger publicKey , privateKey , n ;

    // Create RSA function 	    
    RSA(int bits)
    {
        BigInteger p = BigInteger .probablePrime(bits, random) ;
        BigInteger q = BigInteger .probablePrime(bits, random) ;
        n = p.multiply(q) ;
        BigInteger z = (p.subtract(one)).multiply((q.subtract(one))) ;
        publicKey = new BigInteger("65537") ;
        privateKey = publicKey.modInverse(z) ;
    }

    //Converte string to integer
    static BigInteger toBigInteger(String str)
    {
        byte [] b = new byte[str.length()] ;
        for(int i = 0 ; i<str.length(); i++)
            b = (byte)str.charAt(i);
        return new BigInteger(b) ;
    }

     //Converte integer to string
    static String intToString(BigInteger n)
    {
        byte [] b = n.toByteArray() ;
        StringBuffer s = new StringBuffer() ;
        for(int i = 0 ; i<b.length; i++)
            s.append((char)b) ;
        return s.toString() ;
    }

    //Encrypt function
    static BigInteger encryp(String plain , BigInteger e)
    {
        BigInteger c = toBigInteger(plain).modPow(e,n) ;
        return c;
    }

    //Decrypt function
    static BigInteger decrype(BigInteger cygher , BigInteger d)
    {
        BigInteger m = cygher.modPow(d,n) ;
        return m;
    }

    //The main function
    public static void main(String [] args)
    {
        RSA rsa = new RSA(234) ;
        String m = "Hello I need to encrypt this text" ;
        BigInteger c = encryp(m,publicKey) ;
        System.out.println(c) ;
        BigInteger plain = decrype(c,privateKey) ;
        System.out.println(intToString(plain)) ;
    }
}

وهي الـ caesar

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */


package cesars;


import java.util.Scanner;

public class caesar3 {
    private static input input;
    private static input output;

    public static void main(String[] args) throws java.io.IOException {
		// read input from console
		System.out.println("Enter Plaintext: ");   // prompt
		Scanner consoleInput = new Scanner(System.in); // set up scanner
		String input = consoleInput.nextLine();   // get line from console
		// Note - if you want to read an integer from the console,
		// use nextInt - see documentation for Scanner

		char chars[] = input.toCharArray();  // break String up into chars
		for (int i=0; i < chars.length; i++) // iterate through the chars
			chars = Encrypt(chars); // update cipher to each char
		String output = new String(chars);   // convert back into a String
		 // write out String
		System.out.println("PlainText:  "+input);
		System.out.println("CipherText: "+output);
	}

	public static char Encrypt (char x) // function to apply the cipher to a char
	{

	if(Character.isLetter(x))
	{
		if(Character.isLowerCase(x))
		{
			int ascii_x = (int) x;
			ascii_x -=97;
			ascii_x = (ascii_x+3)%26;
			return (char) (ascii_x + 97);
		}
		else{
		    int	ascii_x = (int) x;
			ascii_x -=65;
			ascii_x = (ascii_x+3)%26;
			return (char) (ascii_x + 65);
		}
	}else
		return x;
    }


public static void u(String[] args) throws java.io.IOException {
System.out.println("Enter Ciphertext: ");   // prompt
		Scanner consoleOutput = new Scanner(System.in); // set up scanner
		String Output = consoleOutput.nextLine();

                char chars[] = output.toCharArray();  // break String up into chars
		for (int i=chars.length; i > chars.length; i--) // iterate through the chars
			chars = Decrypt(chars); // update cipher to each char
		String output = new String(chars);   // convert back into a String
		 // write out String
		//System.out.println("CiText:  "+input);
		System.out.println("CipherText: "+output);
    }


public static char Decrypt (char x) // function to apply the cipher to a char
	{
int temp;
	if(Character.isLetter(x))
	{
		if(Character.isUpperCase(x))
		{
			temp= (int)x;
			temp= temp +97;
			temp = (x-3)%26;
			return (char) (temp - 97);
		}
		else{
		    temp = (int)x;
			temp=temp+65;
			temp = (temp-3)%26;
			return (char) (temp-65);
		}
	}else
		return x;
}
}

وهي ال DES

ملف الـ arrayprinter

/*
 *   *       Please Visit us at www.codemiles.com     *
 *  This Program was Developed by www.codemiles.com forums Team
 *  *           Please Don't Remove This Comment       *
 */

public class arrayprinter {

    /** Creates a new instance of arrayprinter */
    public arrayprinter() {
    }
    public static void printarray(String[][] arr,String label) {
       DesPanel.StepsText.append("-- "+label+" -- "+'\n');
        //System.out.println("-- "+label+" -- ");
        for(int i=0;i<arr.length ;i++) {
             DesPanel.StepsText.append("| ");
            for(int j=0;j<arr[0].length;j++) {

                 DesPanel.StepsText.append(arr[j]+" ");
            }
             DesPanel.StepsText.append("| "+'\n');
        }
    }
}
/*
 *   *       Please Visit us at www.codemiles.com     *
 *  This Program was Developed by www.codemiles.com forums Team
 *  *           Please Don't Remove This Comment       *
 */

وهي ملف الـ SBox

/*
 *   *       Please Visit us at www.codemiles.com     *
 *  This Program was Developed by www.codemiles.com forums Team
 *  *           Please Don't Remove This Comment       *
 */

public class SBox {

    /** Creates a new instance of SBox */
    public SBox() {
    }

    public void DoDecimal(int [] num){
        dec1[0]=num[0];
        dec1[1]=num[5];
        row=1*dec1[1]+2*dec1[0];

        //System.out.print("-------"+row);

    }


    public void DoFourDecimal(int [] num){
        dec2[0]=num[1];
        dec2[1]=num[2];
        dec2[2]=num[3];
        dec2[3]=num[4];
        col=1*dec2[3]+2*dec2[2]+dec2[1]*4+dec2[0]*8;

        //System.out.print("***********"+col);

    }
    public void SelectSBox(int choice, int row, int col){

        switch(choice){
            case 0: SBox_Result[index1]=SBOX1[row][col]; index1++; break;
            case 1: SBox_Result[index1]=SBOX2[row][col]; index1++; break;
            case 2: SBox_Result[index1]=SBOX3[row][col]; index1++; break;
            case 3: SBox_Result[index1]=SBOX4[row][col]; index1++; break;
            case 4: SBox_Result[index1]=SBOX5[row][col]; index1++; break;
            case 5: SBox_Result[index1]=SBOX6[row][col]; index1++; break;
            case 6: SBox_Result[index1]=SBOX7[row][col]; index1++; break;
            case 7: SBox_Result[index1]=SBOX8[row][col]; index1++; break;
        }

    }

    public void make32bit(int num){
        int num1 = 0,num2,num3;
        num1=num;
        System.out.println("Code ");
        for(int i=0; i<4; i++){

            num2=num1%2;
            num3=num1/2;
            num1=num3;
            after_SBox[index2]=num2;

            System.out.print(after_SBox[index2]);
            index2++;

        }

    }
    public void Reverse(int [] num){
        int count=0;
        int fix=3;
        int temp1,temp2;
        while(count!=32){
            for(int i=0; i<2; i++){

                temp1=num[count+i];

                num[count+i]=num[fix-(count+i)];
                num[fix-(count+i)]=temp1;

            }
            fix+=8;
            count+=4;
        }


    }
    public void Fill_P()   {
        int index=0;
        for(int row=0;row<8; row++){
            for(int col=0; col<4; col++){
                store_num[index]=P[row][col];
                index++;
            }

        }


    }

    public void Do_P(int [] after_SBox, int [] func_out ){
        int temp=0;
        int i=0;
        int loop=0;
        int check=0;
        while(check!=32){
            temp=store_num;
            if(temp==loop){
                func_out[check]=after_SBox[loop-1];
                loop=0;
                check++;
                i++;
            }
            loop++;
        }

    }

    public void DoSBox(int [] XOR_Out, int [] S_Out){

        DesPanel.StepsText.append("*********S-Box Stages********* "+'\n');
        int count=0;
        int choice=0;
        int i;
        index=0;
        while(count!=48){

            for(i=0; i<6; i++) {
                temp=XOR_Out[i+count];

            }
            System.out.println(" ");
            DoDecimal(temp);
            //  System.out.println();
            DoFourDecimal(temp);
            //    System.out.println();
            SBox_row[index]=row;
            SBox_col[index]=col;
            SelectSBox(choice,SBox_row[index],SBox_col[index]);
            System.out.println(index+" ="+SBox_Result[index]+"ROW "+row+" COL "+col);

            make32bit(SBox_Result[index]);


            index++;
            choice++;
            count+=6;

        }
        Reverse(after_SBox);
        index=0;

        for(int d=0 ; d<4; d++){
            for(int j=0; j<8; j++){
                after_SBoxs[d][j]=Integer.toString(after_SBox[index]);
                index++;
            }
        }
        index=0;
        arrayprinter.printarray(after_SBoxs,"Final Result After SBoxes");

        Fill_P();
        Do_P(after_SBox,func_out);


                for(int d=0 ; d<4; d++){
            for(int j=0; j<8; j++){
                func_outS[d][j]=Integer.toString(func_out[index]);
                index++;
            }
        }
        index=0;
        arrayprinter.printarray(func_outS,"After IP");
        for(int j=0; j<32; j++)
            S_Out[j]=func_out[j];
        //   System.out.println();


    }

    private int index=0;
    private int[] func_out=new int[32];
    private int [] store_num=new int[32];
    private String text48;
    private int [] after_SBox=new int[32];
    private int index1=0;
    private int index2=0;
    private int row=0;
    private int col=0;
    private int [] SBox_Result=new int [8];
    private int[] SBox_row=new int[8];
    private int[] SBox_col= new int[8];
    private int [] dec1=new int[2];
    private int [] dec2=new int[4];
    private int[] temp =new int[6];
    private 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}
    };

    private int [][] SBOX2=
    {{15, 1, 8, 14, 6, 11, 3, 4, 9, 7, 2, 13, 12 ,0, 5, 1},
     {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}
    };

    private int [][] SBOX3={{10 ,0 ,9 ,14 ,6 ,3 ,15 ,5 ,1 ,13 ,12 ,7 ,11 ,4 ,2 ,8},
    {13, 7, 0, 9, 3, 4, 6, 10, 2 ,8 ,5 ,14, 12, 11, 15, 1},
    {13, 6, 4, 9, 8 ,15 ,3 ,0, 11, 1, 2, 12, 5, 10, 14, 7},
    {1, 10, 13, 0, 6, 9, 8, 7, 4, 15, 14, 3, 11, 5, 2, 12}
    };

    private int [][] SBOX4={{7 ,13 ,14 ,3 ,0 ,6 ,9 ,10 ,1 ,2 ,8 ,5 ,11 ,12 ,4 ,15},
    {13 ,8 ,11 ,5, 6 ,15, 0 ,3 ,4 ,7 ,2 ,12 ,1 ,10 ,14 ,9},
    {10, 6, 9, 0, 12, 11, 7 ,13, 15, 1, 3, 14, 5, 2, 8, 4},
    {3, 15, 0, 6, 10, 1, 13, 8, 9, 4 ,5 ,11 ,12, 7, 2, 14}
    };

    private int [][] SBOX5={{2 ,12 ,4 ,1 ,7 ,10 ,11 ,6 ,8 ,5 ,3 ,15 ,13 ,0 ,14 ,9},
    {14, 11, 2, 12, 4, 7, 13, 1, 5, 0, 15, 10, 3 ,9 ,8 ,6},
    {4 ,2, 1, 11, 10, 13, 7 ,8 ,15, 9, 12, 5, 6, 3, 0, 14},
    {11, 8, 12 ,7, 1, 14 ,2 ,13 ,6 ,15, 0 ,9, 10, 4, 5, 3}
    };

    private int [][] SBOX6={{12 ,1 ,10 ,15, 9 ,2, 6 ,8 ,0 ,13 ,3 ,4 ,14 ,7 ,5 ,11},
    {10, 15, 4 ,2 ,7 ,12 ,9, 5, 6, 1, 13 ,14 ,0, 11, 3 ,8},
    {9, 14, 15, 5, 2 ,8 ,12, 3, 7 ,0 ,4 ,10, 1, 13 ,11 ,6},
    {4, 3, 2, 12, 9, 5, 15 ,10 ,11, 14, 1, 7, 6, 0, 8, 13}
    };

    private int [][] SBOX7={ {4, 11, 2, 14, 15, 0, 8, 13, 3, 12, 9, 7 ,5 ,10 ,6 ,1},
    {13, 0, 11, 7, 4, 9, 1, 10, 14 ,3 ,5, 12, 2, 15, 8, 6},
    {1, 4, 11, 13, 12, 3, 7 ,14, 10, 15, 6, 8, 0, 5, 9, 2},
    {6, 11, 13, 8 ,1 ,4, 10, 7, 9, 5 ,0 ,15 ,14, 2, 3, 12}
    };
    private int [][] SBOX8={ {13, 2, 8, 4, 6, 15, 11, 1 ,10, 9, 3, 14, 5, 0, 12, 7},
    {1, 15, 13, 8 ,10, 3 ,7 ,4 ,12, 5, 6 ,11, 0, 14, 9, 2},
    {7, 11, 4, 1 ,9 ,12 ,14 ,2 ,0 ,6 ,10, 13 ,15 ,3 ,5 ,8},
    {2, 1, 14, 7 ,4 ,10, 8 ,13, 15, 12, 9, 0, 3, 5, 6, 11}
    };
    private int [][] P={{16 ,7 ,20 ,21},
    {29, 12, 28, 17},
    {1, 15, 23, 26},
    {5, 18, 31, 10},
    {2 ,8 ,24 ,14},
    {32, 27, 3, 9},
    {19, 13, 30, 6},
    {22, 11, 4, 25}
    };
    private String after_SBoxs [][]= new String[4][8];
    private String func_outS [][]= new String[4][8];
}
/*
 *   *       Please Visit us at www.codemiles.com     *
 *  This Program was Developed by www.codemiles.com forums Team
 *  *           Please Don't Remove This Comment       *
 */

وهي ملف الـ Permutation

/*
 *   *       Please Visit us at www.codemiles.com     *
 *  This Program was Developed by www.codemiles.com forums Team
 *  *           Please Don't Remove This Comment       *
 */

class Permutation {

    /** Creates a new instance of Permutation */
    public Permutation() {

    }
    public void FillPermutation()   {
        int index=0;
        for(int row=0;row<8; row++){
            for(int col=0; col<8; col++){
              store_num[index]=permutation[row][col];/// from 2D to 1 D
              index++;
            }
        }

    }
      public void FillInversePermutation()   {
        int index=0;
        for(int row=0;row<8; row++){
            for(int col=0; col<8; col++){
              store_num[index]=inverperm[row][col];/// from 2D to 1 D
              index++;
            }
        }

    }
    public void DoIP(int [] perm_in, int [] perm_out) {
        int temp=0;
        int i=0;
        int loop=0;
        int check=0;
        while(perm_in.length!=check){
            temp=store_num;
            if(temp==loop){
                perm_out[check]=perm_in[loop-1];
                loop=0;
                check++;
                i++;
            }
            loop++;
        }
        System.out.println("The Permutted output");
        for(int j=0; j<perm_out.length; j++){
            System.out.print(perm_out[j]);

        }
        int index=0;
        for(int g=0; g<8; g++){
            for(int j=0; j<8; j++){
                permS[g][j]=Integer.toString(perm_in[index]);
                index++;
            }
        }

        arrayprinter.printarray(permS,"After Initial Permutation");

    }
    public void DoInverseIP(int [] perm_in, int [] perm_out) {
        int temp=0;
        int i=0;
        int loop=0;
        int check=0;
        while(perm_in.length!=check){
            temp=store_num;
            if(temp==loop){
                perm_out[check]=perm_in[loop-1];
                loop=0;
                check++;
                i++;
            }
            loop++;
        }
       int index=0;
            for(int d=0; d<4;d++){
            for(int j=0; j<8; j++){
                newBlock64[d][j]=Integer.toString(perm_out[index]);

                index++;
            }
        }
       arrayprinter.printarray(newBlock64,"After IP");

    }
    private int[] store_num= new int[64];
    private int permutation[][]={{58,50,42,34,26,18,10,2},
    {60, 52, 44 ,36, 28, 20, 12 ,4},
    {62 ,54 ,46 ,38 ,30 ,22 ,14 ,6},
    {64 ,56, 48, 40, 32, 24 ,16, 8},
    {57 ,49 ,41 ,33 ,25 ,17 ,9 ,1},
    {59 ,51, 43 ,35 ,27 ,19 ,11, 3},
    {61 ,53 ,45, 37, 29 ,21 ,13 ,5},
    {63 ,55 ,47 ,39 ,31 ,23, 15, 7}};

    private int inverperm[][]=
    {{40 , 8 ,48, 16, 56, 24, 64, 32},
     {39, 7, 47, 15, 55 ,23, 63, 31},
     {38 ,6 ,46 ,14, 54, 22 ,62, 30},
     {37 ,5 ,45, 13, 53 ,21, 61, 29},
     {36 ,4 ,44 ,12 ,52 ,20 ,60 ,28},
     {35 ,3 ,43 ,11, 51, 19 ,59 ,27},
     {34 ,2 ,42, 10 ,50, 18 ,58, 26},
     {33, 1 ,41, 9 ,49, 17, 57, 25}};
    private String permS[][] = new String[8][8];
    private String newBlock64 [][]= new String[4][8];


}
/*
 *   *       Please Visit us at www.codemiles.com     *
 *  This Program was Developed by www.codemiles.com forums Team
 *  *           Please Don't Remove This Comment       *
 */

وهي ملف الـ KeyGen

/*
 *   *       Please Visit us at www.codemiles.com     *
 *  This Program was Developed by www.codemiles.com forums Team
 *  *           Please Don't Remove This Comment       *
 */

public class KeyGen {

    /** Creates a new instance of KeyGen */
    public KeyGen() {

    }

    public void FillPC_1()   {
        int index=0;
        for(int row=0;row<8; row++){
            for(int col=0; col<7; col++){
                store_num[index]=PC_1[row][col];
                index++;
            }
        }
    }

    public void FillPC_2()   {
        int index=0;
        for(int row=0;row<8; row++){
            for(int col=0; col<6; col++){
                store_num1[index]=PC_2[row][col];
                index++;
            }
        }
    }
    public void DoPC_1(int [] key_in, int [] key_out) {
        int temp=0;
        int i=0;
        int loop=0;
        int check=0;
        while(check!=56){
            temp=store_num;
            if(temp==loop){
                key_out[check]=key_in[loop-1];
                loop=0;
                check++;
                i++;
            }
            loop++;
        }

        System.out.println("The Permutted key");
        for(int j=0; j<key_out.length; j++){
            System.out.print(key_out[j]);
        }

        int index=0;
        for(int g=0; g<7; g++){
            for(int j=0; j<8; j++){
                keyS[g][j]=Integer.toString(key_out[index]);
                index++;
            }
        }

        arrayprinter.printarray(keyS,"After PC-1");
    }


    public void DoPC_2(int [] key_in, int [] key_out) {
        int temp=0;
        int i=0;
        int loop=0;
        int check=0;
        while(check!=48){
            temp=store_num1;
            if(temp==loop){
                key_out[check]=key_in[loop-1];
                loop=0;
                check++;
                i++;
            }
            loop++;
        }

                int index=0;
        for(int g=0; g<6; g++){
            for(int j=0; j<8; j++){
               finalS[g][j]=Integer.toString(key_out[index]);
                index++;
            }
        }

        arrayprinter.printarray(finalS,"After PC-2");
        index=0;
    }

    public void DoSegementation(int [] key_out,int [] C, int[] D){
        int index=0;
        for(int i=0; i<28; i++)
            C=key_out;

        for(int i=28; i<56; i++){
            D[index]=key_out;

            index++;
        }


        index=0;
        for(int g=0; g<4; g++){
            for(int j=0; j<7; j++){
                cS[g][j]=Integer.toString(key_out[index]);
                index++;
            }

        }

        for(int g=0; g<4; g++){
            for(int j=0; j<7; j++){
                dS[g][j]=Integer.toString(key_out[index]);
                index++;
            }



        }
        index=0;

        arrayprinter.printarray(cS,"Segment Key to C part");
        arrayprinter.printarray(dS,"Segment Key to D part");
    }
    public void Do_OneLeftShitf(int[] side1, int []side2){

        int temp=side1[0];
        for(int i=1; i<side1.length; i++){

            side1[i-1]=side1;


        }
        side1[side1.length-1]=temp;
        temp=side2[0];
        for(int i=1; i<side2.length; i++){

            side2[i-1]=side2;


        }
        side2[side2.length-1]=temp;

        System.out.println("After One left shift");
        for(int j=0; j<side1.length; j++){
            System.out.print(side1[j]);
        }
    }






    private int[] store_num= new int[56];
    private int[] store_num1= new int[48];
    private int[][] PC_1={{57 ,49 ,41 ,33 ,25 ,17 ,9},
    {1, 58, 50, 42, 34, 26, 18},
    {10, 2,59, 51, 43, 35, 27},
    {19, 11, 3, 60, 52, 44, 36},
    {63, 55, 47, 39, 31, 23, 15},
    {7, 62, 54, 46, 38, 30, 22},
    {14, 6, 61, 53, 45, 37, 29},
    {21, 13, 5 ,28, 20, 12, 4}
    };
    private int[][] PC_2={{14, 17, 11, 24, 1, 5},
    {3, 28, 15, 6, 21, 10},
    {23, 19, 12, 4,26, 8},
    {16, 7, 27, 20, 13, 2},
    {41, 52, 31, 37, 47, 55},
    {30, 40, 51, 45, 33, 48},
    {44, 49, 39, 56, 34, 53},
    {46, 42, 50, 36, 29, 32}
    };
    private String key;
    private String keyS[][]= new String[7][8];
    private String cS[][] = new String [4][7];
    private String dS[][] = new String [4][7];
    private String finalS[][] = new String [6][8];

}
/*
 *   *       Please Visit us at www.codemiles.com     *
 *  This Program was Developed by www.codemiles.com forums Team
 *  *           Please Don't Remove This Comment       *
 */

وهي ملف الـ ESTable

/*
 *   *       Please Visit us at www.codemiles.com     *
 *  This Program was Developed by www.codemiles.com forums Team
 *  *           Please Don't Remove This Comment       *
 */

public class ESTable {

    /** Creates a new instance of ESTable */
    public ESTable() {
    }

    public void FillETable()   {
        int index=0;
        for(int row=0;row<8; row++){
            for(int col=0; col<6; col++){
                store_num[index]=ETable[row][col];
                index++;
            }
        }

    }
    public void DoETable(int [] Right_in, int [] Right_out){
        int temp=0;
        int i=0;
        int loop=0;
        int check=0;
        while(check!=48){
            temp=store_num;
            if(temp==loop){
                Right_out[check]=Right_in[loop-1];
                loop=0;
                check++;
                i++;
            }
            loop++;
        }
            System.out.println(" ");
            System.out.print(" E- table ");
        for(int j=0;j<48;j++)
            System.out.print(Right_out[j]);
            int index=0;
            for(int g=0; g<6; g++){
                for(int j=0; j<8; j++){
                    RightS[g][j]=Integer.toString(Right_out[index]);
                    index++;
                }
            }
            arrayprinter.printarray(RightS,"After E-Table");
        index=0;
    }


    private int[] store_num= new int[48];
    private int [][] ETable= {{32, 1, 2, 3, 4, 5},
    {4 ,5 ,6 ,7 ,8 ,9},
    {8 ,9 ,10 ,11 ,12 ,13},
    {12 ,13 ,14 ,15 ,16 ,17},
    {16, 17, 18, 19, 20, 21},
    {20, 21, 22, 23, 24, 25},
    {24, 25, 26, 27, 28, 29},
    {28, 29, 30, 31, 32, 1}};
    private String RightS[][] = new String[6][8];
}
/*
 *   *       Please Visit us at www.codemiles.com     *
 *  This Program was Developed by www.codemiles.com forums Team
 *  *           Please Don't Remove This Comment       *
 */

وهي ملف الـ encrypt

 /*
 *   *       Please Visit us at www.codemiles.com     *
 *  This Program was Developed by www.codemiles.com forums Team
 *  *           Please Don't Remove This Comment       *
 */

import java.util.Scanner;

public class encrypt {

    /** Creates a new instance of encrypt */
    public encrypt(  String Plaintext, String Key) {




        PlainText=Plaintext;
        keyword=Key;


    }

    public String CheckLenPlain(String plain){
        if(plain.length()%8!=0) {
            int len=8-plain.length()%8;

            for(int i=0; i<len; i++)
                plain=plain.concat("*");

        } else {
            return plain;
        }
        return plain;

    }


    public void DoEncrpyt_Plaintext(String plain) {

        for(int i=0;i<8&&i<plain.length();i++) {
            block=getBinaryBits(plain.charAt(i));// 2D array [8][8]

        }
        int index=0;
        for(int i=0; i<8; i++){
            for(int j=0; j<8;j++){
                perm[index]=(int)block[j];
                blockS[j]=Integer.toString((int)block[j]);
                index++;

            }
        }
        arrayprinter.printarray(blockS,"PlainText Text in Binary");
        DesPanel.StepsText.append("****************************************************************"+'\n');

    }


    public void DoEncrpyt_keyword() {



        for(int i=0;i<8&&i<keyword.length();i++) {
            block=getBinaryBits(keyword.charAt(i));
            for(int j=0;j<8;j++) {

                blockS[j]=Integer.toString((int)block[j]);


            }
            //  System.out.println(" ");
        }


        int index=0;
        for(int i=0; i<8; i++){
            for(int j=0; j<8;j++){
                key_in[index]=(int)block[j];
                index++;

            }
        }

        arrayprinter.printarray(blockS,"KeyWord Text in Binary");
        DesPanel.StepsText.append("****************************************************************"+'\n');

    }

    public byte[] getBinaryBits(int ch) {
        byte[] bin=new byte[8];
        int tag=1;
        for(int i=0;i<8;i++) {
            bin[7-i]=(byte)((ch&((tag<<i)))>>i);
        }
        return bin;
    }

    public void DoSegmentation(int[] perm_out){
        int index=0;
        for(int i=0; i<32; i++)
            Left=perm_out;

        for(int i=32; i<64; i++){
            Right[index]=perm_out;

            index++;
        }
        index=0;
        for(int i=0; i<4;i++){
            for(int j=0; j<8; j++){
                LeftS[j]=Integer.toString(Left[index]);
                RightS[j]=Integer.toString(Right[index]);
                index++;
            }
        }
        arrayprinter.printarray(LeftS,"Left Part");
        arrayprinter.printarray(RightS,"Right Part");

    }
    public void XOR(int side1[], int [] side2,int [] result){
        int index=0;
        for(int i=0; i<side1.length; i++){
            if(side1==side2)
                result[index]=0;
            else
                result[index]=1;
            index++;

        }





    }
    public void FillC_D(){
        int index=28;
        for(int i=0; i<28; i++)
            C_D=C;

        for(int i=0; i<28; i++){
            C_D[index]=D;
            index++;
        }


    }
    public void contancate() {
        int index=32;
        for(int i=0; i<32; i++)
            Block64=Left;

        for(int i=0; i<32; i++){
            Block64[index]=Right;
            index++;
        }
    }
    public void swap32() {
        int temp;
        for(int i=0;i<32;i++) {
            temp=Left;
            Left=Right;
            Right=temp;
        }
        ind=0;
        for(int i=0; i<4;i++){
            for(int j=0; j<8; j++){
                LeftS[j]=Integer.toString(Left[ind]);
                RightS[j]=Integer.toString(Right[ind]);
                ind++;
            }
        }
        arrayprinter.printarray(LeftS,"Left Part");
        arrayprinter.printarray(RightS,"Right Part");
        ind=0;
    }

    public static int[] getByteFromBits(int bits64[]) {
        // int ch[]=new int[8];
        int index=0;
        System.out.println();
        for(int i=0;i<8;i++)
            for(int j=1;j<=8;j++) {


            ch+=(int)Math.pow(2,(8-j))*bits64[index];
            index++;

            }

        return ch;
    }

    public void Chooser(int choice){
        if(choice==1){
            System.out.println("before One left shift " + index);
            for(int j=0; j<C.length; j++)
                System.out.print(C[j]);
            key.Do_OneLeftShitf(C,D);
            System.out.println();
            System.out.println("After One left shift " + index);
            for(int j=0; j<C.length; j++)
                System.out.print(C[j]);
        }

        else{

            for(int j=0; j<C.length; j++)
                System.out.print(C[j]);

            key.Do_OneLeftShitf(C,D);
            key.Do_OneLeftShitf(C,D);
            System.out.println(" LEFT= ");

            for(int j=0; j<C.length; j++)
                System.out.print(C[j]);

            System.out.println(" Right= ");

            for(int j=0; j<D.length; j++)
                System.out.print(D[j]);

        }

    }

    public void DoDecryption() {
        DesPanel.StepsText.append("************************DECIPHER***********************************"+'\n');
        int start=0;

        int counter=0;
        int end=64;
        for(int f=0; f<PlainText.length()/8; f++){

              int Round=1;
            for(int h=start; h<end; h++ ){
                newBlock64_[counter]=Integer.parseInt(finalEncry.substring(h,h+1));
                counter++;
            }
            DesPanel.StepsText.append("*********Block Number *********"+(f+1)+'\n');
            ind=0;
            DesPanel.StepsText.append("*********Cipher Block In Round ********* "+ Round+'\n');
            for(int d=0 ; d<8; d++){
                for(int j=0; j<8; j++){
                    newBlock64_S[d][j]=Integer.toString(newBlock64[ind]);
                    ind++;
                }
            }
            arrayprinter.printarray(newBlock64_S,"Cipher Block");



            p= new Permutation();

            p.FillPermutation();//step1 from 2D to 1D
            p.DoIP(newBlock64_,perm_out);
            DoSegmentation(perm_out);

            int adder=48;

            while(Round<=16) {
                DesPanel.StepsText.append("*********Round Number********* "+Round+'\n');
                for(int i=0; i<48; i++) {
                    reversedkey=Integer.parseInt(key_reverse.substring((key_reverse.length()-adder)+i,(key_reverse.length()-adder)+i+1));

                }
                System.out.println();
                ESTable Etable = new ESTable();
                Etable.FillETable();//step3 array from 2D to 1D
                Etable.DoETable(Right,Right_out);//step3
                DesPanel.StepsText.append("*********Right Part XORED with Round Key********* "+Round+'\n');
                XOR(Right_out,reversedkey,XOR_Out);//step1
                ind=0;
                for(int g=0; g<6; g++){
                    for(int j=0; j<8; j++){
                        XORS[g][j]=Integer.toString(XOR_Out[ind]);
                        ind++;

                    }
                }
                arrayprinter.printarray(XORS,"XOR Result");
                ind=0;
                SBox sbox= new SBox();

                sbox.DoSBox(XOR_Out,after_SBox);//step2 32bits - include permitation
                DesPanel.StepsText.append("*********Left Part XORED with Output Function in Round********* "+Round+'\n');
                XOR(Left,after_SBox,aft_XOR_fuc);//XOR



                for(int g=0; g<4; g++){
                    for(int j=0; j<8; j++){
                        aft_XOR_fucS[g][j]=Integer.toString(aft_XOR_fuc[ind]);
                        ind++;

                    }
                }
                ind=0;
                arrayprinter.printarray(aft_XOR_fucS,"XOR Result");

                adder=adder+48;
                Round++;
                DesPanel.StepsText.append("*********Left=Right & Right=Left*********"+'\n');
                for(int i=0;i<32;i++) {
                    Left=Right;
                    Right=aft_XOR_fuc;
                }


            }

            ind=0;
            for(int g=0; g<4; g++){
                for(int j=0; j<8; j++){
                    LeftS[g][j]=Integer.toString(Right[ind]);
                    RightS[g][j]=Integer.toString(aft_XOR_fuc[ind]);
                    ind++;

                }
            }
            arrayprinter.printarray(LeftS,"Left Part");
            arrayprinter.printarray(RightS,"Right Part");

            DesPanel.StepsText.append("********After Swap Operation********* " +'\n');
            swap32();




            contancate();
            System.out.println("/nBit Swap :");
            for(int i=0;i<64;i++) {
                System.out.print(Block64);
            }

            p.FillInversePermutation();//step1 from 2D to 1D
            p.DoInverseIP(Block64,newBlock64);//step1 -array

            System.out.println("The decyption code: ");
            for(int i=0; i<64; i++) {
                if(binDec==null)
                    binDec=Integer.toString(newBlock64);
                else
                    binDec+=Integer.toString(newBlock64);
                System.out.print(newBlock64);
            }
            System.out.println(" ");
            ch=getByteFromBits(newBlock64);


            for(int i=0; i<8; i++){
                System.out.print((char)ch);
                if(finalDecry==null)
                    finalDecry=Character.toString((char)ch);
                else
                    finalDecry+=Character.toString((char)ch);
            }

            for(int i=0; i<8; i++)
                ch=0;
            start=end;
            end=end+64;
            counter=0;

        }


    }

    public String getBinDec(){
        return binDec;
    }
    public void DoEncryption(){
        DesPanel.StepsText.append("************************CIPHER***********************************"+'\n');
        DoEncrpyt_keyword();
        int start=0;
        int end=8;
        PlainText=CheckLenPlain(PlainText);
//        System.out.println("PlainTETX: "+ PlainText.substring(start,start+9));

        String temp;
        for(int f=0; f<PlainText.length()/8; f++){


            temp=PlainText.substring(start,end);

            DoEncrpyt_Plaintext(temp);


            System.out.println("The Orginal Massage code: ");
            for(int i=0;i<64;i++) {
                if(binCi==null)
                    binCi=Integer.toString(perm);
                else
                    binCi+=Integer.toString(perm);
                System.out.print(perm);
            }
            int Round=1;

            DesPanel.StepsText.append("*********Block Number *********"+(f+1)+'\n');
            System.out.println(" ");
            Permutation p= new Permutation();
            p.FillPermutation();//step1 from 2D to 1D
            p.DoIP(perm,perm_out);//step1 -array
            DoSegmentation(perm_out);//step2 to Left and Right
            // Here u will work on Right (32 Bits ) & Left 32 Bits
            ////////////////////////////////////////////////////////////////////////
            /////////////////////////////key Generation////////////////////////////

            key.FillPC_1();//step1 -array
            System.out.println();
            DesPanel.StepsText.append("*********Key Generation*********" +'\n');
            key.DoPC_1(key_in,key_out);//step1

            key.DoSegementation(key_out,C,D);//step2

            while(Round<=16) {
                DesPanel.StepsText.append("*********Round Number********* "+Round+'\n');

                int chooser=num_Left[index_chooser];
                ESTable Etable = new ESTable();
                Etable.FillETable();//step3 array from 2D to 1D
                Etable.DoETable(Right,Right_out);//step3

                ////////////////////////////////////////////////////////////////////////
                System.out.println();
                Chooser(chooser);//step 3 - shift
                System.out.println("Chooser = "+chooser);
                key.FillPC_2();//step4 array
                FillC_D();//step4 contacnate 56bits
                DesPanel.StepsText.append("*********Key For Round Number********* "+Round+'\n');
                key.DoPC_2(C_D,final_key);//step4 here the key of Round 1
                for(int i=0; i<48;i++) {
                    if(key_reverse==null)
                        key_reverse=Integer.toString(final_key);
                    else
                        key_reverse+=Integer.toString(final_key);

                }


                ////////////////////////////////////////////////////////////////////////
                ////////////////////////////////////////////////////////////////////////
                DesPanel.StepsText.append("*********Right Part XORED with Round Key********* "+Round+'\n');
                XOR(Right_out,final_key,XOR_Out);//step1
                ind=0;
                for(int g=0; g<6; g++){
                    for(int j=0; j<8; j++){
                        XORS[g][j]=Integer.toString(XOR_Out[ind]);
                        ind++;

                    }
                }
                ind=0;

                arrayprinter.printarray(XORS,"XOR Result");
                System.out.print("\nXOR :");
                for(int j=0;j<48;j++) {
                    System.out.print(XOR_Out[j]);
                }
                SBox sbox= new SBox();

                sbox.DoSBox(XOR_Out,after_SBox);//step2 32bits - include permitation
                System.out.print("\nS-BOX :");
                for(int j=0;j<32;j++) {
                    System.out.print(after_SBox[j]);
                }
                System.out.print("\n AFter XOR  :");
                DesPanel.StepsText.append("*********Left Part XORED with Output Function in Round********* "+Round+'\n');
                XOR(Left,after_SBox,aft_XOR_fuc);//XOR



                for(int g=0; g<4; g++){
                    for(int j=0; j<8; j++){
                        aft_XOR_fucS[g][j]=Integer.toString(aft_XOR_fuc[ind]);
                        ind++;

                    }
                }
                ind=0;
                arrayprinter.printarray(aft_XOR_fucS,"XOR Result");

                for(int j=0;j<32;j++) {
                    System.out.print(aft_XOR_fuc[j]);
                }


                Round++;
                index++;
                index_chooser++;

                DesPanel.StepsText.append("*********Left=Right & Right=Left*********"+'\n');
                for(int i=0;i<32;i++) {
                    Left=Right;
                    Right=aft_XOR_fuc;
                }

                ind=0;
                for(int g=0; g<4; g++){
                    for(int j=0; j<8; j++){
                        LeftS[g][j]=Integer.toString(Right[ind]);
                        RightS[g][j]=Integer.toString(aft_XOR_fuc[ind]);
                        ind++;

                    }
                }
                arrayprinter.printarray(LeftS,"Left Part");
                arrayprinter.printarray(RightS,"Right Part");


            }

            DesPanel.StepsText.append("********After Swap Operation*********"+'\n');
            swap32();

            contancate();
            System.out.println("/nBit Swap :");
            for(int i=0;i<64;i++) {
                System.out.print(Block64);
            }

            p.FillInversePermutation();//step1 from 2D to 1D
            DesPanel.StepsText.append("********* Inverse Permutation Operation in Round *********"+(f+1)+'\n');
            p.DoInverseIP(Block64,newBlock64);//step1 -array
            System.out.println(" ");
            System.out.println("/nThe Encyption code: ");
            for(int i=0; i<newBlock64.length; i++){
                System.out.print(newBlock64);
                if(finalEncry==null)
                    finalEncry=Integer.toString(newBlock64);
                else
                    finalEncry+=Integer.toString(newBlock64);

            }
            start=end;
            end=end+8;
            index_chooser=0;

        }
        System.out.println("");
        System.out.println("Final :"+ finalEncry);



    }
    public String getEncryption(){
        return finalEncry;
    }

    public String getDecryption(){
        return finalDecry;
    }
    public String getBinCi(){
        return binCi;
    }
    private int ind=0;
    private String binDec;
    private String binCi;
    private  static Permutation p;
    private String keyword;
    private int index_chooser=0;
    private String PlainText;
    private static int index=0;
    private String cyphir;
    private static int [] reversedkey=new int[48];
    private static String key_reverse ;
    private static  KeyGen key=new KeyGen();
    private static int Block64[]=new int[64];
    private static int[]num_Left= {1,1,2,2,2,2,2,2,1,2,2,2,2,2,2,1};
    private static int ch[]=new int[8];
    private static int newBlock64[]=new int[64];
    private static int [] aft_XOR_fuc=new int[32];
    private static String [][] aft_XOR_fucS=new String[4][8];
    private static int [] after_SBox=new int[32];
    private static int[] C_D=new int[56];
    private static int[] XOR_Out=new int[48];
    private static int key_in[]=new int[64];
    private static int final_key[]=new int[48];
    private static int key_out[]=new int[56];
    private static int [] Left=new int[32];
    private static int[] Right=new int[32];
    private static int[] Right_out=new int[48];
    private static int[] perm=new int[64];
    private static int[] perm_out= new int[64];
    private static int  newBlock64_[]=new int[64];
    private static int C[]=new int[28];
    private static int D[]=new int[28];
    private byte[][] block=new byte[8][8];
    private String [][] blockS= new String[8][8];
    private String finalEncry;
    private String finalDecry;
    private String Plain_Dec;
    private String LeftS[][] = new String[4][8];
    private String RightS[][] = new String[4][8];
    private String XORS[][] = new String[6][8];
    private String [][] newBlock64_S = new String[8][8];
}
/*
 *   *       Please Visit us at www.codemiles.com     *
 *  This Program was Developed by www.codemiles.com forums Team
 *  *           Please Don't Remove This Comment       *
 */

وهي ملف الـ DesMain

/*
 *   *       Please Visit us at www.codemiles.com     *
 *  This Program was Developed by www.codemiles.com forums Team
 *  *           Please Don't Remove This Comment       *
 */

import java.awt.BorderLayout;
import java.awt.Container;
import java.awt.FlowLayout;
import java.awt.GridLayout;
import java.awt.Toolkit;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.BorderFactory;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTextArea;
import javax.swing.JTextField;
import javax.swing.text.AbstractDocument;
import javax.swing.text.AttributeSet;
import javax.swing.text.BadLocationException;
import javax.swing.text.Document;
import javax.swing.text.DocumentFilter;
/*
 * DesMain.java
 *
 * Created on May 1, 2007, 3:16 PM
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

/**
 *
 * @author Mohammed
 */
public class DesMain   {

    /** Creates a new instance of DesMain */
    public DesMain() {
    }

    public static void main(String [] rr){
        DesPanel  mm = new DesPanel();
        mm.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        mm.setVisible(true);
    }
}
class DesPanel extends JFrame{
    public DesPanel(){
        this.setTitle("Des");
        this.setSize(800,800);
        this.setVisible(true);

        GenerateGUI();
    }
    encrypt en;
    public static   JTextArea StepsText = new JTextArea(10,40);


    private    Container c=this.getContentPane();
    private    JButton btnCihper = new JButton("Cipher");
    private    JButton btnDeCihper = new JButton("Decipher");

    private   JTextArea CipherText = new JTextArea(4,40);
    private   JTextArea OriginalText = new JTextArea(4,40);
    private   JTextArea DeCipherText = new JTextArea(4,40);


    private    JScrollPane OriginalScorl=new JScrollPane(OriginalText,
            JScrollPane.VERTICAL_SCROLLBAR_ALWAYS,JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS);
    private    JScrollPane CipherScorl=new JScrollPane(CipherText,
            JScrollPane.VERTICAL_SCROLLBAR_ALWAYS,JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS);
    private  JScrollPane DecipherScorl=new JScrollPane(DeCipherText,
            JScrollPane.VERTICAL_SCROLLBAR_ALWAYS,JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS);
    private   JScrollPane StepScorl=new JScrollPane(StepsText,
            JScrollPane.VERTICAL_SCROLLBAR_ALWAYS,JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS);
    private  JTextField KeyWord = new JTextField(16);
    private  JTextField KeyWordTwo = new JTextField(16);
    private  JPanel PanelCipher = new JPanel();
    private  JPanel PanelDecipher = new JPanel();
    private  JPanel PanelKeyWord = new JPanel();

    private  JPanel PanelOriginaltxt = new JPanel();
    private JPanel jpstep=new JPanel();

    private  JLabel lblKeyWord= new JLabel("KeyWord : ");


    private void GenerateGUI(){
        c.setLayout(new GridLayout(4,1));

        Document doc = KeyWord.getDocument();
        AbstractDocument absDoc = (AbstractDocument )doc;
        absDoc.setDocumentFilter(new DocumentSizeFilter(8));
        KeyWord.setSize(10,1);


        c.setLayout(new FlowLayout());

        PanelKeyWord.setLayout(new FlowLayout());
        PanelKeyWord.add(lblKeyWord);
        PanelKeyWord.add(KeyWord);


        PanelOriginaltxt.setBorder(BorderFactory.createTitledBorder("Original Text"));
        PanelOriginaltxt.setLayout(new FlowLayout());
        PanelOriginaltxt.add(OriginalScorl);

        PanelCipher.setBorder(BorderFactory.createTitledBorder("Cipher Text"));
        PanelCipher.setLayout(new FlowLayout());
        PanelCipher.add(CipherScorl);
        PanelCipher.add(btnCihper);

        PanelDecipher.setBorder(BorderFactory.createTitledBorder("Decipher Text"));
        PanelDecipher.setLayout(new FlowLayout());
        PanelDecipher.add(DecipherScorl);
        PanelDecipher.add(btnDeCihper);
        jpstep.setBorder(BorderFactory.createTitledBorder("Mointor"));
        jpstep.setLayout(new FlowLayout());
        jpstep.add(StepScorl);


        c.add(PanelKeyWord);

        c.add(PanelOriginaltxt);
        c.add(PanelCipher);
        c.add(PanelDecipher);
        c.add(jpstep);

        DoActions();


    }
    private void DoActions(){
        ActionHandler action = new ActionHandler();

        btnCihper.addActionListener(action);
        btnDeCihper.addActionListener(action);

    }

    private class ActionHandler implements ActionListener{


        public void actionPerformed(ActionEvent e) {
            if(e.getSource()==btnCihper){
                String plaintext=OriginalText.getText();
                String keyworD=KeyWord.getText();
                StepsText.append("keyword : "+keyworD+'\n');
                StepsText.append("PlainText : "+plaintext+'\n');
                en= new encrypt(plaintext,keyworD);
                en.DoEncryption();
                //OriginalText.append("\n "+ en.getBinCi());

                CipherText.append(en.getEncryption());

            }
            if(e.getSource()==btnDeCihper){
                en.DoDecryption();
                DeCipherText.append("\n "+en.getBinDec());
                DeCipherText.setCaretPosition(DeCipherText. getDocument().getLength());
                DeCipherText.append("\n"+en.getDecryption());
            }
        }

    }
    private String fina;

}

class DocumentSizeFilter extends DocumentFilter {
    int maxCharacters;

    public DocumentSizeFilter(int maxChars) {
        maxCharacters = maxChars;
    }

    public void insertString(FilterBypass fb, int offs, String str, AttributeSet a) throws BadLocationException {

        if ((fb.getDocument().getLength() + str.length()) <= maxCharacters)
            super.insertString(fb, offs, str, a);
        else
            Toolkit.getDefaultToolkit().beep();
    }

    public void replace(FilterBypass fb, int offs, int length, String str, AttributeSet a) throws BadLocationException {

        if ((fb.getDocument().getLength() + str.length()- length) <= maxCharacters)
            super.replace(fb, offs, length, str, a);
        else
            Toolkit.getDefaultToolkit().beep();
    }

}




/*
 *   *       Please Visit us at www.codemiles.com     *
 *  This Program was Developed by www.codemiles.com forums Team
 *  *           Please Don't Remove This Comment       *
 */

بتمني منكم تساعدوني ............ وبعتذر منكم لان تأخرت بتزيل الطلب

يا عبدي اطْلُبْني دائِماً و اجتَهِدْ

تُعْطَى لكْ جنَّاتُ عدْنٍّ لِلأَبدْ

في جوار نبيٍّ اسمُهُ أحمدْ

طُوبَى لكْ طُوبَى لكْ إِن صحْ لكْ هذا الْقَبولْ

#2

:wacko: :wacko:

يا عبدي اطْلُبْني دائِماً و اجتَهِدْ

تُعْطَى لكْ جنَّاتُ عدْنٍّ لِلأَبدْ

في جوار نبيٍّ اسمُهُ أحمدْ

طُوبَى لكْ طُوبَى لكْ إِن صحْ لكْ هذا الْقَبولْ

#3

شو يا جماعة الخير

على اساس انكن بتقدموا مساعدات للمحتاج , وينكن؟

:wacko: :wacko:

يا عبدي اطْلُبْني دائِماً و اجتَهِدْ

تُعْطَى لكْ جنَّاتُ عدْنٍّ لِلأَبدْ

في جوار نبيٍّ اسمُهُ أحمدْ

طُوبَى لكْ طُوبَى لكْ إِن صحْ لكْ هذا الْقَبولْ

#4

ارفقي المشروع مجموع على شكل ملف rar

وتكلمي عن مشكلتك

تحياتي

حزمة المحرك الإصدارة 0.8

أي أحد يجد أني ظلمته فليراسلني

وبإذن الله لو كان له حق سيأخذه

728x90.png

#5
علاء الصالحي كتب:

ارفقي المشروع مجموع على شكل ملف rar

وتكلمي عن مشكلتك

تحياتي

أخي الله يكرمك أنا جهازي مضروب ومابيفتح الا ملفات وورد و بوربوينت وحتى برنامج الضغط خربان عندي وناطرة يوم ال22 اخلص مشان افرمت لان انا هلأ بحاجة الجهاز وماعندي وقت افرمت مشان هيك ماعم اعرف اشتغل اي شي بهالمشروع وماعندي وقت اشتغل

بقى المطلوب ان نعمل برنامج لتشفير ملف او فك تشفيره حسب خوارزميات التشفير يلي معنا بالكورس وطبعا كان معنا واجب بعض هاي الخوارزميات يلي انا منزلاهم وهنن شغالين ان شاء الله بس هلأ المطلوب اربط الخوارزميات بواجهة البرنامج الموجودة في الموضوع الاصلي

وانا رح ابعتلك المطلوب منا بالضبط

247488040.jpg

أخي الله يوفقك اذا فيك تخلصني من هالورطة والا والله برسب بالمادة لان المشروع عليه نص العلامة :( :( :(

يا عبدي اطْلُبْني دائِماً و اجتَهِدْ

تُعْطَى لكْ جنَّاتُ عدْنٍّ لِلأَبدْ

في جوار نبيٍّ اسمُهُ أحمدْ

طُوبَى لكْ طُوبَى لكْ إِن صحْ لكْ هذا الْقَبولْ

#6

أختي الكريمة، إن لم تكوني تعملين على المشروع أساساً، فأنت لديك كل الوقت الكافي لتهيئة النظام وتثبيت البرامج الأساسية اللازمة فقط.

يؤسفني القول بأن طلب حلول الواجبات بهذا الشكل في المنتدى غير مرحب به، فالمنتدى لنشر العلم و لكن ليس من خلال تعويد الطلاب على الاتكال مهما كانت الأعذار والأسباب الخاصة بهم.

الخوارزميات الموضوعة في الأعلى منسوخة من موقع، وليست بجهدك الشخصي، بالتالي هي ليست مكتوبة أساساً بناء الخطوات المطلوبة في المشروع، أي أن مساهمتك في المشروع حتى الآن صفر.

أتمنى أن تعيدي مراجعة نفسك فهذا ليس أسلوب مبرمج أو طالب IT بشكل عام.

مهما كانت قاسية كلماتي، فأنا أعبّر عن لسان حال الكثيرين ممن امتنعوا عن المشاركة في الموضوع.

1

Do as I say, not as I do

We are Anonymous. We are Legion. We don't forgive. We don't forget

#7
Xacker كتب:

الخوارزميات الموضوعة في الأعلى منسوخة من موقع، وليست بجهدك الشخصي، بالتالي هي ليست مكتوبة أساساً بناء الخطوات المطلوبة في المشروع، أي أن مساهمتك في المشروع حتى الآن صفر.

أتمنى أن تعيدي مراجعة نفسك فهذا ليس أسلوب مبرمج أو طالب IT بشكل عام.

مهما كانت قاسية كلماتي، فأنا أعبّر عن لسان حال الكثيرين ممن امتنعوا عن المشاركة في الموضوع.

الله يسامحك اخي والله هذه الخوارزميات بمجهودي الشخصي وكانت مطلوبة معنا واجبات للمادة طول الفصل والمشروع النهائي ربط الخوارزميات يلي اخذناها و عملتيها بان تشفر بدل النص ملف ولكن طبعا انا خبرتي صفر بالملفات

عالعموم بتشكرك عالرد المحفز لي جدا و يسعدني ان اقول لك ان الموضوع أرغب في حذفه

:wacko:

تشكرات لحضرتكم مرة تانية

أستفدنا منكم كثير والمشروع لو بدو ييجي منكم أنا ماعاد بدي ياه

يا عبدي اطْلُبْني دائِماً و اجتَهِدْ

تُعْطَى لكْ جنَّاتُ عدْنٍّ لِلأَبدْ

في جوار نبيٍّ اسمُهُ أحمدْ

طُوبَى لكْ طُوبَى لكْ إِن صحْ لكْ هذا الْقَبولْ

#8

يا أختي أنتي حتى لم تكلفي نفسك بإزالة الترويسة الخاصة بالموقع الذي جلبت منه الملفات

صدقيني نعرف منذ البداية أنك لم تقومي بشيء من هذه الشيفرة

لكنا أردنا مساعدتك

فتقومي بوضع الواجب الخاص بك

بالنسبة لي هذا يعني شيء واحد أنتي حتى لم تقرئي الشيفرة التي وضعتها هنا

لذا فأنا أتجاهل الموضوع

أتمنى لك التوفيق

وعندما تقرري أن تعملي سنساعدك

الموضوع مغلق لطلب حل واجب

تحياتي

حزمة المحرك الإصدارة 0.8

أي أحد يجد أني ظلمته فليراسلني

وبإذن الله لو كان له حق سيأخذه

728x90.png

هذا الموضوع مغلق.

مواضيع مشابهة