Professional Documents
Culture Documents
1. Reconnaissance:
1. Network
2. Host
3. People involved
2. Scanning:
3. Gaining Access:
4. Maintaining Access:
Penetration Testing
Ethical Hacking
Normally, accessibility of
whole computer systems
and its infrastructure As per the situation, it normally
doesn’t require. requires a whole range of
Accessibility is required accessibility all computer systems
only for the part for which and its infrastructure.
the tester performing pen
testing.
Man-in-the-middle attack
In cryptography and computer security, a man-in-the-middle
attack (MITM) is an attack where the attacker secretly relays and
possibly alters the communications between two parties who
believe that they are directly communicating with each other. One
example of a MITM attack is active eavesdropping, in which the
attacker makes independent connections with the victims and
relays messages between them to make them believe they are
talking directly to each other over a private connection, when in
fact the entire conversation is controlled by the attacker. The
attacker must be able to intercept all relevant messages passing
between the two victims and inject new ones. This is
straightforward in many circumstances; for example, an attacker
within the reception range of an unencrypted Wi-Fi access
point could insert themselves as a man-in-the-middle.[1][2][3]
Caesar Cipher in Cryptography
The Caesar Cipher technique is one of the earliest and simplest
method of encryption technique. It’s simply a type of substitution
cipher, i.e., each letter of a given text is replaced by a letter some
fixed number of positions down the alphabet. For example with a
shift of 1, A would be replaced by B, B would become C, and so
on. The method is apparently named after Julius Caesar, who
apparently used it to communicate with his officials.
Thus to cipher a given text we need an integer value, known as
shift which indicates the number of position each letter of the text
has been moved down.
The encryption can be represented using modular arithmetic by
first transforming the letters into numbers, according to the
scheme, A = 0, B = 1,…, Z = 25. Encryption of a letter by a
shift n can be described mathematically as.
C=(P+K) mod 26
P= (c-k ) mod 26
Examples :
D =3
C=p +k mod 26
4+23=27 mod 26 =1
Text : ABCDEFGHIJKLMNOPQRSTUVWXYZ
Shift: 23
Cipher: XYZABCDEFGHIJKLMNOPQRSTUVW
Text : ATTACKATONCE
Shift: 4
Cipher: EXXEGOEXSRGI
Algorithm for Caesar Cipher:
Input:
1. A String of lower case letters, called Text.
2. An Integer between 0-25 denoting the required shift.
Procedure:
Traverse the given text one character at a time .
For each character, transform the given character as per the
rule, depending on whether we’re encrypting or decrypting the
text.
Return the new string generated.
Program that receives a Text (string) and Shift value( integer) and
returns the encrypted text.
C++
Java
Python
C#
PHP
filter_none
edit
play_arrow
brightness_4
// A C++ program to illustrate
Caesar Cipher Technique
#include <iostream>
using namespace std;
// This function receives text
and shift and
// returns the encrypted text
string encrypt(string text,
int s)
{
string result = "";
// traverse text
for (int
i=0;i<text.length();i++)
{
// apply
transformation to each
character
// Encrypt Uppercase
letters
if (isupper(text[i]))
result +=
char(int(text[i]+s-65)%26
+65);
// Encrypt Lowercase
letters
else
result +=
char(int(text[i]+s-97)%26
+97);
}
// Return the resulting
string
return result;
}
// Driver program to test the
above function
int main()
{
string
text="ATTACKATONCE";
int s = 4;
cout << "Text : " << text;
cout << "\nShift: " << s;
cout << "\nCipher: " <<
encrypt(text, s);
return 0;
}
Output:
Text : ATTACKATONCE
Shift: 4
Cipher: EXXEGOEXSRGI