Copyright © infotec016 . Powered by Blogger.

Monday, November 6, 2017

Web Tech


Technologies a Web Developer should know...

  Web browser
It is a software application for retrieving, presenting, traversing information resources on the world wide web.   
Information resource is identified by URL(Uniform Resource Locator).
 Eg:
  • Netscape Navigator                                                     
  • Internet Explorer 
  • Safari
  • Opera
  • Mozilla Firefox
  • Google Chrome

Wednesday, July 19, 2017

Wednesday, July 12, 2017

Internet and web



Introduction to internet and web


The Internet is a networks of network worldwide.

www (worldwide web)

The www is an architectural frame work for accessing linked spread out all over the internet.

Client-Server Computing Architecture


Friday, May 26, 2017

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

Friday, January 6, 2017

Web Hosting


1.Buy a Domain
2.Order a web hosting service
3.Create the website

 Domain Name

Domain Name is the web address of a website.
We will need a domain to create a website.
To get own domain name, we need to register it with a domain register. 
Examples for domain register : 
  • GoDaddy
  • Name Cheap 
  • Domain.com