Copyright © infotec016 . Powered by Blogger.

Showing posts with label Crypto. Show all posts
Showing posts with label Crypto. Show all posts

Saturday, June 18, 2022

Proxy Server (Act on behalf of another)


Proxy server, which connects a computer network and the internet, retrieves the data on the internet on behalf of the user. It hides the IP address of a connected device in the public network and retrieve the web content/ data with the identity of its ip address.

Benefits...

  • Privacy: It allows the user to surf the internet anonymously
  • Speed: Proxy stores the web page in centralized cache database. So for the next time users can get it from the proxy server and no need to go for the internet.
  • Saves Bandwidth:Tthrough caching 
  • Activity loging: Keeps the record of users activity and block websites.

No encryption machanisms in Proxy.


Thursday, April 20, 2017

Cryptography


Crypto System

Cryptographic system are characterized along 3 independent dimensions


  • The type of operation transforming plain text to cipher text
  • The number of keys used
  • The way in which plain text is processed.
Substitution techniques
  • Caesar Cipher
  • Monoalphabatic Cipher
  • Playfair Cipher
  • Hill Cipher
  • Polyalphabatic Cipher

Transposition techniques
  • Rail fence Cipher
  • Columnar transposition 

Cryptography : Caesar Cipher


Caesar Cipher

Sample java code for Caesar Cipher

key : each letter shift of two in alphabet order
caesar cipher encryption

eg: hello -----------jgnnq
encryption


import java.util.*;
public class encryption{
public static void main(String args[]){
Scanner myScanner=new Scanner(System.in);
String alpha="abcdefghijklmnopqrstuvwxyz";
String word,text="";
System.out.println("Enter the plain text");
word=myScanner.nextLine().toLowerCase();
System.out.println("cipher text");
for(int i=0;i<word.length();i++){
boolean found=false;
char a=word.charAt(i);
int j=0;
while(j<alpha.length() && !found ){
char b=alpha.charAt(j);
if(a==' '){
text=text+" ";
found=true;
}
else if(a==b ){
found=true;
if(j<24){
text=text+alpha.substring(j+2,j+3);
}
else{
text=text+alpha.substring(j-alpha.length()+2,j-alpha.length()+3);
}
}
j++;
}
}
System.out.print(text);
}
}

output of the above code
   

Cryptography : Vigenere Cipher


Vigenere Cipher

Sample java code for Vigenere Cipher

Encryption

//Vigenere cipher encryption
import java.util.*;
public class vigenere_encry{
public static void main(String args[]){
Scanner myscanner=new Scanner(System.in);
String alpha="abcdefghijklmnopqrstuvwxyz";
String keynew="",cipher="";
System.out.println("Enter the key");
String key=myscanner.nextLine().toLowerCase().replace(" ","");
System.out.println("Enter the plaintext");
String word=myscanner.nextLine().toLowerCase().replace(" ","");
int k=0;
while(k<word.length()/key.length()){
for(int i=0;i<key.length();i++){
keynew=keynew+key.charAt(i);
}
k++;
}

int q=0;
if(word.length()%key.length()!=0){
while(q<word.length()%key.length()){
keynew=keynew+key.charAt(q);
q++;
}
}
System.out.println("key       :"+keynew);
System.out.println("plaintext :"+word);

int numk=0,numw=0;
for(int i=0;i<word.length();i++){
char chark=keynew.charAt(i);
char charw=word.charAt(i);
for(int j=0;j<=25;j++){
if(chark==alpha.charAt(j)){
numk=j;
}
if(charw==alpha.charAt(j)){
numw=j;
}
}
cipher=cipher+alpha.charAt((numk+numw)%26);
}
System.out.println("ciphertext:"+cipher);
}
}



output of the above code

Cryptography : Playfair Cipher


Playfair Cipher

Sample java code for Playfair Cipher


Encryption




//playfair encryption: i and j count as one letter
import java.util.*;
public class playfair_encry{
public static void main(String args[]){
Scanner myscanner=new Scanner(System.in);
System.out.println("Enter the keyword");
String key=myscanner.nextLine().toLowerCase().replace(" ","").replace("j","i");
String alpha="abcdefghiklmnopqrstuvwxyz";
char array[][];
array=new char[5][5];
char arraykey[];
arraykey=new char[key.length()];
arraykey[0]=key.charAt(0);
int m=1;

Cryptography : Railfence Cipher


Railfence Cipher

Sample java code for Railfence Cipher

Key = 2
Encryption


//key=2
import java.util.Scanner;
public class Railfence_encry{
    public static void main(String args[]){
        Scanner myscanner =new Scanner(System.in);
        System.out.println("Enter the plaintext");
        String word=myscanner.nextLine().replace(" ","");
        System.out.println("cipher text");
        
        for(int i=0;i<word.length();i++){
            char a=word.charAt(i);
            if(i%2==0){
                System.out.print(a);
            }
        }
        

Cryptography : Railfence Cipher


Railfence Cipher


Sample java code for Railfence Cipher

Key = 3
Encryption


//key=3
import java.util.*;
public class Railfence1_encry{
    public static void main(String args[]){
        Scanner myscanner =new Scanner(System.in);
        System.out.println("Enter the plaintext");
        String word=myscanner.nextLine().replace(" ","").toLowerCase();
        System.out.println("cipher text");
int i=0;
String text1="",text3="";
while(i<word.length()){
char a=word.charAt(i);
text1=text1+a;
i=i+2;
if(i<word.length()){
a=word.charAt(i);
text3=text3+a;
}
i=i+2;
}
System.out.print(text1);
for(int j=1;j<word.length();j=j+2){
char a=word.charAt(j);
System.out.print(a);
}
System.out.println(text3);
    }
}
     

output of  the above code

Monday, December 5, 2016

Challenges that we face in computer security


Computer security is preserving the integrity, availability, and confidentiality of information system resources.

Now,People think that their private accounts and data are safe but still their data may be changed ,theft,or edited by unauthorized people.People should create a secure password and know the all security facilities and implement that facilities.

System developers also develop the systems more securely for users.

People should take attention when they use their private accounts in public computers.

People should backup their important data.


Wednesday, November 9, 2016

ICT


Information & Communication Technology



      Information and communication technology (ICT) is an extended term for information technology(IT) which stresses the role of unified communications and the integration of telecommunications (telephone lines and wireless signals), computers as well as necessary  enterprise software, middleware, storage, and audio-visual systems, which enable users to access, store, transmit, and manipulate information.

   The term ICT is also used to refer to the convergence of audio-visual and telephone networks with computer networks through a single cabling or link system. There are large economic incentives (huge cost savings due to elimination of the telephone network) to merge the telephone network with the computer network system using a single unified system of cabling, signal distribution and management.

      However, ICT has no universal definition, as "the concepts, methods and applications involved in ICT are constantly evolving on an almost daily basis."  The broadness of ICT covers any product that will store, retrieve, manipulate, transmit or receive information electronically in a digital form, e.g. personal computers, digital television, email, robots. 


Ict in the field of education

  • The ability to learn anytime anywhere,web based training
  • Learning management
  • Serves as the teaching aid for the teachers
  • Possibility of higher education for everyone
  • Distance learning