is code
is code
#include <stdio.h>
#include <string.h>
#include <ctype.h>
int main()
char plaintext[100];
char ciphertext[100];
scanf("%s", plaintext);
scanf("%d", &key);
length = strlen(plaintext);
char c = toupper(plaintext[i]);
{
ciphertext[i] = (c - '0' + key) % 10 + '0';
else
ciphertext[i] = c;
ciphertext[i] = '\0';
return 0;
#include <stdio.h>
#include <string.h>
int main() {
char ciphertext[100];
scanf("%s", ciphertext);
char c = ciphertext[i];
putchar(c);
return 0;
#include <stdio.h>
#include <string.h>
int main() {
int key = 3;
// Encryption
int k = 0;
enc[k++] = msg[i];
enc[k] = '\0';
printf("Original: %s\n", msg);
// Decryption
int idx = 0;
dec[i] = enc[idx++];
dec[len] = '\0';
return 0;
}
3. Substitution and transposition
#include <stdio.h>
#include <string.h>
Int main() {
Char msg[] = “HELLO”, enc[100], dec[100];
Int key = 3, len = strlen(msg), k = 0;
4RSA
#include <stdio.h>
Int main() {
Int p, q, e, d, n, phi, msg, enc = 1, dec = 1;
N = p * q;
Phi = (p – 1) * (q – 1);
// Encryption: c = (msg^e) % n
For (int i = 0; i < e; i++)
Enc = (enc * msg) % n;
// Decryption: m = (enc^d) % n
For (int i = 0; i < d; i++)
Dec = (dec * enc) % n;
Printf(“Encrypted message: %d\n”, enc);
Printf(“Decrypted message: %d\n”, dec);
Return 0;
}
Sure! Here's a simple definition and example for each of the following: MD5, SHA1, WHOIS,
DIG, TRACERT, and NSLOOKUP.
🌐 3. WHOIS
Definition:
WHOIS is a command-line tool or protocol used to find information about a domain name, such
as the owner's name, registrar, creation/expiry date, etc.
Example:
$ whois google.com
Output (shortened):
Domain Name: GOOGLE.COM
Registrar: MarkMonitor Inc.
Creation Date: 1997-09-15
Expiry Date: 2028-09-14
🌍 4. DIG (Domain Information Groper)
Definition:
DIG is used to query DNS servers for information about a domain like IP address, mail servers,
etc. It helps troubleshoot DNS issues.
Example:
$ dig google.com
Output (shortened):
;; ANSWER SECTION:
google.com. 299 IN A 142.250.77.206
🔎 6. NSLOOKUP
Definition:
NSLOOKUP is a command-line tool used to find the IP address of a domain name or get DNS
information.
Example:
$ nslookup google.com
Output:
Name: google.com
Address: 142.250.77.206
7. SQL Injection
Definition:
SQL Injection is a web attack where malicious SQL code is injected into input fields to
manipulate the database.
Example:
' OR '1'='1
➡️Input like this can bypass login systems or leak data.
💉 8. Injector
Definition:
"Injector" is a general term for any tool or method that injects code or data into a system or
application, often used for exploits (like SQLi, XSS, DLL injection, etc.).
Example:
SQL Injector tool
DLL Injector for modifying running programs
➡️Injectors are commonly used in hacking or penetration testing.
3. Wireshark
Definition:
Wireshark is a network protocol analyzer used to capture and inspect packets of data flowing
through a network in real time.
Use Case:
Debugging network problems
Viewing packet-level details of TCP, HTTP, DNS, etc.
Detecting suspicious activity or attacks
Example:
Open Wireshark
Start capture on Wi-Fi or Ethernet
Filter: http, icmp, tcp.port == 80
Screenshot Output (typical):
No. Time Source Destination Protocol Info
1 0.000 192.168.1.2 8.8.8.8 DNS Standard query A
google.com
✅ Summary Table:
Term Purpose Type Example Use
Network
ARP IP ↔ MAC address mapping Sending data in LAN
tool
Let me know if you want a mini project or practical demo using these!