Saturday, 25 March 2023

CYBER LAW

 

CYBER LAW

Introduction to Cyber law : Cyberlaw is the area of law that deals with the Internet's relationship to  technological and electronic elements, including computers, software, hardware and information systems (IS).

Ethics and Morals       

Ethics : Also called moral philosophy is the discipline concerned with what is morally good and bad, right or wrong.

Morals : The standards of behaviour; principles of right and wrong behaviour. Thus morals are dictated by society, culture or religion while ethics are chosen by the person himself which governs his life. This chapter introduces the do's and dont's of cyber world.

Cyber Crime -Computer Crime is alternatively referred to as cybercrime, e-crime, (electronic crime) or hi-tech crime. Computer crime is an act performed by a knowledgeable computer user, sometimes referred to as a hacker who illegally browses or steals a company's or individual's private information.

Examples of cyber crime

1) Software Piracy : Software piracy is nothing but copyright violation of

 software created originally by an individual or an institution. It includes stealing of codes/ programs and other information illegally and creating the imitated copy by unauthorized means and utilizing this data either  for own benefit  or for profit  making. Example : When you download a copy of a licensed software. For example downloading games from a file sharing website without paying for it, it is a software piracy.

         2) Unauthorized access : Gaining access without the users' permission is known as unauthorized access. Authorization means granting access rights to resources, which is related to information security computer security and to access control in particular sector.

Examples of unauthorized access are :    

 Hacking financial / bank account related information.       

 Stealing organizational / intellectual information.   

 Illegal monitoring of information owned by other users.   

 Illegal use/break of login and password of other users.

3) Copyright violation : A copyright is a legal right that gives the creator of a literary, artistic, musical, or other creative work the sole right to publish and sell that work.

4) Cracking : Activity such as decipher codes or passwords and breaking  security systems for illegal reasons is called cracking.

5) Cyberbully or Cyberstalking : Cyberstalking is a criminal practice where an individual uses the Internet to systematically harass or threaten someone

6) Phishing : This a technique of extracting confidential information such as credit card numbers and username password combos by pretending as a legal enterprise. Phishing is typically carried out by email spoofing.

7) Plagarism  : Plagarism is presenting someone else's work or idea as your own without their consent. The widespread use of computers and the advent of the internent has made it easier to palagiarize the work of others.

8) Hacking : Hacking refers to unauthorised intrusion into a computer or a network. Hacker is a person intensely interested in the deep and hidden or concealed working of any computer operating system and programming language.

 

 

 

Security Procedures

Encryption : It is a method of converting the original message into random text, which should be complex to understand and difficult for a hacker to decode. The idea is to ensure security and safety of data and its transmission.

 SSL (Secure Socket Layer) : It is the most consistent security model. Through the SSL, transmission of data is encrypted, client-server information is authenticated and also message integrity for TCP/IP connections secured.

Firewall : Firewall refers to network  security (Hardware and Software)  system which blocks certain type of information, forming a barrier between a trusted and untrusted network. It attempts to block the spread of computer attacks.

 

Introduction to DBMS

 

Introduction to DBMS

Database is collection of interrelated data

A Database Management System (DBMS) is a software for creating and managing databases.

Some Applications of DBMS

1)      Railway Reservation System : Database is required to keep record of ticket booking, train’s departure and arrival status, status of seats available etc.

2)       Library Management System :  There are thousands of books in the library so it is very difficult to keep a record of all the books in a copy or register.

3)      Banking : People make thousands of  transactions through banks daily and they can do this without going to the bank.

 

Advantages of DBMS

1)      Reducing Data Redundancy : The file based data management systems contained multiple files that were stored in many different locations in a system or even across multiple systems.

2)      Sharing of Data : In a database, the users of the database can share the data among themselves.

3)      Data Integrity : Data integrity means that the data is accurate and consistent in the database

4)      Data Security : Data Security is vital concept in a database. Only authorised users should be allowed to access the database and their identity should be authenticated using a username and password.

5)      Privacy : The privacy rule in a database means only the authorized users can access a database according to its privacy constraints.

6)      Backup and Recovery : Database Management System automatically takes care of backup and recovery.

 

Data types in the DBMS

 When you create a table or add a field to a table in the database, fields are created with specific data type. Data types are classifications that identify possible values for and operations that can be done on the data, as well as the way the data in that field is stored in the database.

1)      CHAR-Holds a fixed length string (can contain letters, numbers,

2)      VARCHAR-Holds a variable length string (can contain letters, numbers, and special characters).

3)      DECIMAL-It can represent numbers with or without the fractional part

4)      INT- It is used for storing integer values

5)      DATE-t holds the date  including day, month and year

6)      TIME()-It holds time. Format: HH:MM:SS

 

Properties of Transactions : Transactions have the following four standard properties, usually referred to by the acronym ACID.

1)      Atomicity : It ensures that all operations within the work unit are completed successfully. Otherwise, the transaction is aborted at the point of failure and all the previous operations are rolled back to their former state.

2)      Consistency : It ensures that the database properly changes states upon a successfully committed transaction.

3)       Isolation : It enables transactions to  operate independently of and transparent to each other.

4)       Durability : It ensures that the result or effect of a committed transaction persists in case of a system failure.

 

Introduction of RDBMS

 RDBMS stands for Relational Database Management System. In RDBMS a database is considered as a collection of interrelated data.

Table : The table is the basic data storage unit in a Relational database. Table consists of columns and rows.

Field : A table consists of information which is stored under different headings, called as fields or columns.

Record : All the columns in a table make a row. Each row contains information on individual topics.

Primary Key : The group of one or more columns used to uniquely identify each row of a relation is called its Primary Key.

  Foreign Key : It is a field (or collection of fields) in one table that refers to the Primary Key in another table.

 

Relationships in database : Relationships link data from individual tables to increase the usefulness of the database.  A relationship in the context of databases, is a situation that exists  between two relational database tables when one table has a foreign key that  is used as a reference to the primary key of the other table.

 

There are 3 types of relationships in relational database design. They are :

1)  One-to-One            2)One-to-Many (or Many-to-One)      3)  Many-to-Many

1) One-to-One : In a one-to-one relationship, one record in a table is associated with one and only one record in another table

2) One to many- one record in a table is associated with many record in another table.

3) Many-to-Many A many-to-many relationship occurs when multiple records in a table are associated with multiple records in another table

 

Introduction to SQL

SQL is Structured Query Language,  which is a computer language for storing, manipulating and retrieving data stored in a relational database. SQL is the standard language for Relational Database Management System.

Using SQL we  Can :

1)      Create new databases.

2)        Create new tables in a database

3)        Insert records in a database  

4)        Retrieve data from a database

5)       Update records in a database

Categories of SQL Commands

1)      Data Definition Language (DDL) Commands DDL statements or commands are used to define and modify the database structure of your tables or schema.

DDL COMMAND USED FOR

CREATE DATABASE -Creates database

CREATE TABLE- Creates a new table

ALTER TABLE- Modifies a table

DROP TABLE/DROP DATABASE-Deletes a table or Database

 

2)      Data Manipulation Language (DML) Commands Data Manipulation Language (DML) statements or commands are used for managing data within tables.

SELECT -Extracts data from a table

UPDATE -Updates data in a table

DELETE- Deletes data from a table

INSERT INTO-Insert data into a table

 

3)      Data Control Language (DCL) Commands-DCL is used to control user access in a database. it is related to security issue. it is also deals with the rights and permissions of the databse access.

GRANT -To provide access or privileges on the database objects.

REVOKE -To remove access rights or privileges on the database object.

 

Saturday, 18 March 2023

JavaScript Code For Exam

1)      1) Write a event driven JavaScript code to calculate area of circle, Accept radius from user.

<html>

<head>

<title>

Area of circle

</title>

<script language="javascript">

function area()

{

var a=prompt("Enter radius")

var b=3.14*a*a

document.write("Area of circle="+b)

}

</script>

</head>

<body>

<form name="f1">

<h2> Area of Circle</h2>

<input type="submit" value="Area of circle" onclick="area()">

</form>

</body>

</html>

 

2) Write a event driven JavaScript code to calculate area of Rectangle Accept length and breadth from user.

<html>

<head>

<title>

Area of Rectangle

</title>

<script language="javascript">

function area()

{

var l=prompt("Enter Length")

var b=prompt("Enter Breadth")

var area=l*b

document.write("Area of Rectangle="+area)

}

</script>

</head>

<body>

<h2> Area of Rectangle</h2>

<form name="f1">

<input type="submit" value="Area of Rectangle" onclick="area()">

</form>

</body>

</html>

 

3)      Write a event driven JavaScript code to calculate area of Triangle. Accept Base and Height from user.(1/2*b*h)

 

<html>

<head>

<title>

Area of Triangle

</title>

<script language="javascript">

function area()

{

var b=prompt("Enter Base")

var h=prompt("Enter height")

var area=1/2*b*h

document.write("Area of Triangle="+area)

}

</script>

</head>

<body>

<form name="f1">

<h2> Area of Triangle</h2>

<input type="submit" value="Area of Triangle" onclick="area()">

</form>

</body>

</html>

 

4)      Write a event driven JavaScript code to calculate Perimeter of Reactngle. Accept Length and Breadth from user.(Perimeter=1*length + 2*breadth)

 

<html>

<head>

<title>

Perimeter of Reactngle

</title>

<script language="javascript">

function perimeter()

{

var l=prompt("Enter Length")

var b=prompt("Enter Breadth")

var per=(2*l)+(2*b)

document.write("Perimeter of Reactngle="+per)

}

</script>

</head>

<body>

<form name="f1">

<input type="submit" value="Perimeter of Reactngle" onclick="perimeter()">

</form>

</body>

</html>

 

5)      Write a event driven JavaScript code to calculate Addition of Numbers from 50 to 100

 

<html>

<head>

<title>

Addition of numbers

</title>

<script language="javascript">

function cal()

{

var  i,sum=0

for(i=50;i<=100;i++)

{

sum=sum+i

}

document.write("Addition of Numbers from 50 to 100="+sum)

}

</script>

</head>

<body>

<form name="f1">

<h2>Addition of Numbers from 50 to 100</h2>

<input type="submit" value="Addition of Number" onclick="cal()">

</form>

</body>

</html>

6)      Write a event driven JavaScript code to calculate Factorial of given number

 

<html>

<head>

<title>

Factorial of Number

</title>

<script language="javascript">

function fact()

{

var a=prompt("Enter Number")

var f=1,i

for(i=a;i>=1;i--)

{

f=f*i

}

document.write("Factorial of given number="+f)

}

</script>

</head>

<body>

<form name="f1">

<input type="submit" value="Factorial" onclick="fact()">

</form>

</body>

</html>

 


Monday, 6 March 2023

Server-Side Scripting (PHP)

Server Side Scripting (PHP)

PHP(Hypertext Preprocessor)-open source general purpose language.

Especially for web development.

PHP runs on various platform(Linux,Unix,MacOSX,Windows)

PHP is compatible with almost all servers (XAMMP,Apache,NGINX,Lightpad)

PHP Supports wide range of database,Free and open source,Easy to learn.

 

Features of PHP.

1)Simple

2)Interpreted

3)Faster

4)Open Source

5)Platform Independent

6)Case sensitive

7)Error Reporting

8)Real time access monitoring

9)Loosely typed language.

 

echo keyword is used to display text on webpage.

PHP variable

$ keyword is used to declare variable in php.

Variable names are case sensitive

Variable names can not start with number.

Must start with character or alpha-numeric character

Variable scope-local,global,static

 

PHP data types

1)   String                 2)Integer           3) Float

4)Boolean             5)Array              6)NULL

 

PHP comments

Comments are statements which are not visible in output.

a)   Single line comment- //

b)  A multiline comment- /*…….*/

 

Control structure in PHP

1)if statement

2)if-else statement

Loop  structure – used to execute the same block of code repeatedly as long as certain condition is satisfied.

1)For loop

2)foreach loop

 

PHP string Function-

A string is series of characters

A function is a block of statement that can be used repeatedly in a program

 

PHP Arrays

An array is special variable ,which can hold more than on value at a time.Stores multiple values in one single variable.

 

Types of array

1)   Indexed array-Arrays with a numeric index

2)   Associative arrays-Arrays with named keys

3)   Multi-dimensional arrays-Arrays containing one or more arrays

 

PHP Form

The PHP superglobals $_GET and $_POST are used to collect form data.

$_GET is an array of variables passed via the URL parameters.

$_POST is an array of variables passed via the HTTP POST method.

 

$-GET-

$_GET is an array of variables passed via the URL parameters.

Information sent from a form with GET method is visible to everyone.

Limits on the amount of information to send

Used to sending non sensitive data

Never used to sending password and sensitive information.

 

$_POST

$_POST is an array of variables passed via the HTTP POST method.

Information sent from a form with GET method is not visible to anyone.

No limits on the amount of information to send

used to sending password and sensitive information.

Variables are not displayed in the URL.

 

 

Cookies- is a small text file that the servers sends on the user’s computer.

Used to identify user on its machine and track activities created on the user computer.

 

Session-Used to store user information on server to track user activities.

It helps web application to maintain user information on all pages.