CSC 281 student cpy - Cyber Tech, Material Uniport.
CSC 281 student cpy - Cyber Tech, Material Uniport.
Senate-approved relevance:
Training of graduates who are highly skilled in the knowledge of modern technologies used on the cyber space. The
knowledge of this technologies and their use as well as how they are applied on the day to day activities on the society.
These include web applications and email system, file transfers and fundamental way of securing this system using
existing applications. It will also teach students how to develop simple security systems using already existing modules in
programming languages such as Php, Javascript and Python.
Overview:
There are different technologies that are currently in user on the web (Cyber space). Some of these technologies include
web sites - front-end and back-end, File Transfer Protocol apps, Emails, social media, Wikis and search engines, different
online apps. App that non-experts use in hacking are common and should be explored by students as a way of getting
started into the terrain of cybersecurity.
Students need to have a good knowledge of the Cyber space before they can be able to provide security for it.
Introduction to Cyber Technologies does not require the students to have any knowledge of Security or other Courses to
be able to study this technologies which are often used daily in the society, by lower schools and in the fresher years.
Objectives:
1. Describe what good knowledge of web technologies entails, where they are being used and how they work.
2. Illustrate how to deploy already developed web site on the internet using a web host and a domain name.
3. Demonstrate how to use web backends from where the security need to be deployed and the basic operational
knowledge of the need for securing systems.
4. Explain how to breach systems using basic hacking app that are in public domain.
5. Describe how to use built-in programming language cryptographic modules and how they function in a real life
programming environment.
6. Explain web operations and understanding the points were checks are required and if the access methods are
ethical or not.
Learning Outcomes:
1. Explain the concept of Cyber space and the various technologies used in its operations.
3. Design web domain names and host web sites created using web frameworks on these domains.
4. Demonstrate how to use already developed functions/modules in programming languages to practice simple
cryptography.
5. Explain hacking software( preferably the open source) and how to use them.
Course Contents:
Web applications. areas of use of web application. Web application Protocols. Common Tools / App on the web.
Backends application. Social media back ends. Email backend. Web Backends/ hosting app. File Transfer app. Domain
name creation. web hosting using existing web framework like WordPress. Laravel. Django etc. Hacking tools and their
usage. Ethical and Non-Ethical Hacking operations. Introduction to Hack Prevention and recovery tools. Simple
Cryptographic module usage in Programming Languages (PHP/Python/JavaScript / C). MD4(). MD5(). and Encrypt().
COURSE CONTENT:
A web application is a software program that runs on a web server and is accessed through a web browser over
a network, typically the internet. Unlike traditional desktop applications, web applications are not installed
locally on a device but are accessed through a web interface, making them platform-independent and easily
accessible.
1. Accessibility:
o Accessible from anywhere with an internet connection.
o Platform-independent, as they can run on any device with a compatible browser.
2. Dynamic Content:
o Web applications often interact with databases or APIs to provide real-time updates and dynamic
content.
3. No Installation Required:
o Users do not need to download or install web applications; they simply access them via a URL.
4. Cross-Platform Compatibility:
o Work seamlessly across different operating systems and devices.
1. Client-Side:
o This is the front-end of the application, usually developed using HTML, CSS, and JavaScript.
o It focuses on user interface (UI) and user experience (UX).
2. Server-Side:
o This is the back-end of the application where the logic, database interactions, and processing
occur.
o Common server-side languages include Python, PHP, Ruby, Node.js, and Java.
3. Database:
o Stores the data required by the application.
o Examples: MySQL, PostgreSQL, MongoDB, and SQLite.
4. Web Server:
o Hosts the application and serves client requests.
o Examples: Apache, Nginx.
5. Application Programming Interface (API):
o Facilitates communication between the client and server, often using protocols like REST or
GraphQL.
1. E-commerce:
o Amazon, eBay, Shopify.
2. Social Media:
o Facebook, Instagram, Twitter.
3. Productivity Tools:
o Google Docs, Trello, Slack.
4. Entertainment:
o Netflix, Spotify, YouTube.
1. Ease of Access:
o Available 24/7 from any device with internet access.
2. Low Maintenance:
o Updates are applied on the server, eliminating the need for individual installations.
3. Cost-Effective:
o Single development effort for cross-platform compatibility.
4. Scalability:
o Can handle a growing number of users and requests with appropriate infrastructure.
Disadvantages of Web Applications
1. Internet Dependency:
o Require a stable internet connection for optimal performance.
2. Security Risks:
o Vulnerable to cyberattacks like SQL injection, XSS, and DDoS.
3. Performance:
o May be slower compared to native applications due to network latency.
4. Browser Compatibility:
o Performance and features may vary across different web browsers.
Conclusion
Web applications have transformed how we interact with software, offering unparalleled convenience,
accessibility, and scalability. They are widely used across industries and continue to evolve with advancements
in web technologies, such as Progressive Web Apps (PWAs) and cloud computing. Their future lies in
enhanced interactivity, security, and integration with emerging technologies like AI and IoT.
Web applications are versatile tools that serve various purposes across industries. Their flexibility, accessibility,
and scalability make them integral in multiple domains. Below are key areas where web applications are
extensively used:
3. Healthcare
Telemedicine Applications:
o Examples: Practo, Teladoc.
o Facilitate remote consultations, scheduling appointments, and accessing medical records.
Patient Management Systems:
o Examples: MediTech, Cerner.
o Help healthcare providers manage patient data, billing, and appointments.
Health Monitoring Apps:
o Integrate with IoT devices to track fitness and health metrics like heart rate, activity levels, and
sleep.
Social Platforms:
o Examples: Facebook, Instagram, LinkedIn.
o Enable users to connect, share content, and network professionally.
Communication Tools:
o Examples: WhatsApp Web, Slack.
o Facilitate instant messaging, group discussions, and file sharing.
Forums and Communities:
o Examples: Reddit, Quora.
o Provide platforms for discussions, knowledge sharing, and collaboration.
Streaming Services:
o Examples: Netflix, Spotify, YouTube.
o Allow users to stream videos, music, and other media content.
Gaming Platforms:
o Examples: Steam, Xbox Live.
o Provide online multiplayer gaming experiences and digital game libraries.
News and Publishing:
o Examples: BBC, Medium.
o Deliver real-time news updates, articles, and multimedia content.
Online Banking:
o Examples: Chase Online, Wells Fargo.
o Enable users to perform transactions, manage accounts, and apply for loans.
Investment and Trading Platforms:
o Examples: Robinhood, E-Trade.
o Provide tools for stock trading, portfolio management, and market analysis.
Budgeting and Financial Planning:
o Examples: Mint, YNAB (You Need A Budget).
o Help users manage personal finances and track expenses.
E-Government Portals:
o Examples: IRS (USA), Gov.uk (UK).
o Provide access to public services like tax filing, license applications, and social welfare
programs.
Public Information Systems:
o Disseminate real-time updates on traffic, weather, and emergency alerts.
Voting Systems:
o Secure web applications for online voting during elections.
Booking Platforms:
o Examples: Expedia, Airbnb, Booking.com.
o Allow users to book flights, accommodations, and activities.
Navigation and Maps:
o Examples: Google Maps, Waze.
o Provide directions, traffic updates, and nearby attractions.
Customer Support:
o Web applications enable real-time chat, ticketing, and support for travelers.
Recruitment Platforms:
o Examples: LinkedIn Talent Solutions, Workday.
o Facilitate job postings, candidate search, and recruitment processes.
Time Tracking and Productivity Tools:
o Examples: Clockify, Trello.
o Help manage schedules, track productivity, and streamline workflows.
Collaboration Tools:
o Examples: Google Workspace, Microsoft 365.
o Provide web-based applications for document editing, email, and team collaboration.
Data Storage and Sharing:
o Examples: Dropbox, Google Drive.
o Allow users to store and share files online.
Conclusion
Web applications are foundational in modern life, powering activities across industries like education,
healthcare, finance, and entertainment. Their ability to adapt to diverse needs, combined with advancements in
web technologies, ensures their continued growth and innovation in the years to come.
Web application protocols are the rules and standards that govern communication between web servers and
clients (usually browsers). These protocols enable data transfer, security, and user interactions over the web,
ensuring that web applications function smoothly and efficiently.
An extension of HTTP that includes encryption via SSL/TLS (Secure Socket Layer/Transport Layer
Security).
Ensures secure data exchange, protecting against eavesdropping and tampering.
Used for sensitive applications like online banking, e-commerce, and user authentication.
3. WebSocket Protocol
Provides full-duplex communication between a client and server over a single TCP connection.
Unlike HTTP, WebSocket allows persistent connections for real-time communication.
Used in:
o Online gaming.
o Stock market applications.
o Chat applications.
Benefits:
o Low latency.
o Efficient communication with less overhead compared to HTTP.
Allows clients to retrieve emails while keeping them stored on the server.
Enables multi-device synchronization of emails.
Translates human-readable domain names (e.g., www.example.com) into IP addresses that computers
use to locate servers.
Essential for browsing websites and accessing web applications.
9. Secure Protocols
Encrypts data to ensure secure communication between the client and server.
Integral to HTTPS.
Conclusion
Web application protocols are the foundation of modern web interactions, enabling data exchange, security, and
functionality. From HTTP and HTTPS to advanced protocols like WebSocket and REST, these standards ensure
seamless and secure communication in web applications. As technology evolves, new protocols continue to
emerge, addressing the growing complexity and demands of web applications.
1. Productivity Tools
Office Suites:
Examples: Google Workspace (Docs, Sheets, Slides), Microsoft 365 (Word, Excel, PowerPoint).
Enable users to create, edit, and collaborate on documents, spreadsheets, and presentations online.
Project Management:
Time Management:
2. Communication Tools
Email Services:
Video Conferencing:
Instant Messaging:
5. E-Learning Platforms
6. Development Tools
Version Control:
Email Marketing:
8. Entertainment Platforms
Streaming Services:
Online Gaming:
9. E-Commerce Platforms
Online Banking:
Examples: PayPal, Venmo, Google Pay.
Facilitate money transfers, online payments, and account management.
Investment Platforms:
Graphic Design:
Video Editing:
Blogging Platforms:
File Converters:
o Examples: Zamzar, SmallPDF.
o Convert files between different formats (e.g., PDF to Word, image to text).
Web Browsers:
o Examples: Google Chrome, Mozilla Firefox, Microsoft Edge.
o Serve as the primary interface for accessing web applications.
Password Managers:
o Examples: LastPass, 1Password.
o Help users securely store and manage their login credentials.
Conclusion
Web tools and applications are essential in modern life, serving a wide range of needs across personal,
professional, and entertainment domains. Their cloud-based nature ensures accessibility, ease of use, and the
ability to collaborate in real-time. As technology advances, these tools continue to evolve, offering improved
features and greater efficiency.
Backends Applications
The backend of an application, often referred to as the "server-side," is the part of a software system that
handles business logic, database interactions, and the operations necessary to power the front end. It processes
user requests, performs calculations, and ensures data security, providing the foundation for applications like
social media, email, and web hosting.
1. Server:
o Handles incoming requests from the client and sends responses.
o Common server frameworks: Node.js, Django, Flask, Ruby on Rails.
2. Database:
o Stores and manages data required by the application.
o Examples: MySQL, PostgreSQL, MongoDB.
3. Application Logic:
o Implements the business rules and functionality.
o Written in server-side programming languages like Python, Java, PHP, or JavaScript.
4. APIs (Application Programming Interfaces):
o Allow the backend to communicate with the front end and third-party services.
o Examples: REST, GraphQL, gRPC.
1. User Management:
o Handles user registration, authentication, and authorization.
o Manages user profiles, settings, and preferences.
2. Data Storage:
o Stores posts, comments, likes, messages, and multimedia content.
o Uses databases optimized for scalability, such as Cassandra or DynamoDB.
3. Real-time Communication:
o Enables features like live chat, video calls, and real-time notifications.
o Uses technologies like WebSocket, SignalR, or Firebase Realtime Database.
4. Content Moderation:
o Implements algorithms for detecting inappropriate content.
o Backend tools analyze data for spam, abuse, or violations of community guidelines.
5. Analytics and Insights:
o Tracks user engagement metrics, trends, and behavior.
o Tools like Hadoop or Google BigQuery process large datasets.
3. Email Backends
Microsoft Exchange: A server-based email system that integrates with enterprise tools.
Gmail Backend: Built on Google’s proprietary servers using APIs and machine learning for spam
detection.
ProtonMail: Focuses on end-to-end encryption for privacy.
1. Shared Hosting:
o Multiple websites share the same server resources.
o Affordable but limited in scalability.
2. Dedicated Hosting:
o A single server dedicated to one client.
o Offers high performance but is costly.
3. Cloud Hosting:
o Virtual servers distributed across multiple physical machines.
oScalable, reliable, and cost-efficient.
oExamples: AWS (Amazon Web Services), Google Cloud, Microsoft Azure.
4. Content Delivery Network (CDN):
o Caches website content in servers located worldwide for faster delivery.
o Examples: Cloudflare, Akamai.
1. Heroku:
o A platform-as-a-service (PaaS) for deploying and managing applications.
o Supports multiple programming languages.
2. Firebase:
o A Google-backed platform for building backend services, including databases, authentication,
and analytics.
3. AWS Lambda:
o A serverless computing service for running backend code in response to events.
Backend Tools:
Conclusion
Backends are critical for powering the functionality of web, email, and social media applications. They manage
data, ensure security, and support real-time communication, forming the backbone of modern digital
interactions. With advancements in technologies like cloud computing and serverless architectures, backends
are becoming more scalable, efficient, and cost-effective.
File transfer applications are software tools designed to facilitate the sharing, uploading, and downloading of
files between devices or across networks. These apps are widely used in personal, professional, and enterprise
environments for purposes such as sharing documents, media, backups, and system data.
Allow users to share files directly between devices without needing a central server.
Examples: BitTorrent, ShareIt, Zapya.
Common for sharing large files like videos or software.
Allow users to send files as attachments or embedded links via messaging platforms.
Examples: WhatsApp, Telegram, Slack.
Often limited in file size.
Ease of Use:
User-friendly interfaces that allow drag-and-drop uploads or simple sharing via links.
Cross-platform Support:
Many apps support multiple platforms like Windows, macOS, Android, and iOS.
Some apps impose limits on file sizes, especially for free plans (e.g., WeTransfer allows up to 2 GB per
transfer for free users).
Apps like FileZilla and Google Drive offer encryption during data transfer and at rest.
Applications like ShareIt optimize transfer speeds by using direct device-to-device connectivity.
Collaboration Features:
Cloud-based apps (e.g., Google Drive) allow real-time collaboration on shared files.
3.2 Dropbox:
3.3 FileZilla:
3.4 WeTransfer:
3.5 ShareIt:
3.6 WhatsApp:
5. Use Cases
Personal Use:
Professional Use:
Enterprise Use:
Conclusion
File transfer applications are essential for modern digital workflows, enabling fast, secure, and efficient file
sharing. With a wide range of options available, users can choose the tool that best suits their needs, whether for
personal, professional, or enterprise use. As technology advances, these tools will continue to improve, offering
even more convenience and reliability.
A domain name is the human-readable address of a website, serving as a shortcut to its underlying IP address. It
is essential for establishing an online presence, as it identifies a website on the internet and makes it easily
accessible to users. Domain name creation involves selecting, registering, and maintaining a unique name that
aligns with the website's purpose and branding.
Clearly identify the purpose of your website (e.g., business, blog, e-commerce, portfolio).
Use domain name registrars (e.g., GoDaddy, Namecheap) to search for available domain names.
Once available, register the domain name with a trusted domain registrar.
Provide accurate contact information, as required by ICANN (Internet Corporation for Assigned Names
and Numbers).
1. Keep It Short:
o Short names are easier to type, remember, and share.
o Example: "amazon.com" is better than "amazonsuperstore.com."
2. Avoid Hyphens and Numbers:
o These can confuse users or lead to typos.
o Example: Use "mywebsite.com" instead of "my-website123.com."
3. Use Keywords:
o Incorporate keywords related to your business or purpose.
o Example: "fitnessgear.com" for a fitness store.
4. Ensure Uniqueness:
o Avoid names that are too similar to existing trademarks or competitors.
5. Choose the Right Extension:
o Match the extension to your website's purpose or audience.
6. Future-Proof Your Name:
o Avoid overly specific names that might limit future expansion.
Domain name generators can help create ideas when brainstorming. Some popular tools include:
For a Blog:
1. Trademark Compliance:
o Verify that your chosen name does not infringe on trademarks.
o Tools like the USPTO database (for the U.S.) can help with searches.
2. Domain Squatting:
o Avoid purchasing domains solely to resell them at inflated prices.
o ICANN has policies to prevent this unethical practice.
3. Privacy Protection:
o Use WHOIS privacy to prevent exposure of personal details in public records.
Conclusion
Creating a domain name is a critical step in establishing an online identity. A well-chosen domain enhances
visibility, builds trust, and aligns with long-term goals. By following best practices, leveraging tools, and
considering legal and ethical factors, businesses and individuals can secure meaningful, impactful domain
names that support their digital presence.
Web hosting involves deploying a website or web application on a server to make it accessible via the internet.
Popular web frameworks like WordPress, Laravel, and Django simplify the process of web development and
hosting by providing pre-built tools, libraries, and architectural patterns. Each framework has its own
requirements, workflow, and hosting considerations.
1.1 WordPress:
1.2 Laravel:
1.3 Django:
Conclusion
Hosting web applications using frameworks like WordPress, Laravel, and Django provides flexibility and
functionality tailored to different needs. WordPress is ideal for content-driven websites, while Laravel and
Django are better suited for dynamic, custom web applications. By understanding each framework’s hosting
requirements and leveraging appropriate hosting solutions, developers can ensure optimal performance,
scalability, and security for their applications.
Hacking tools are software or hardware utilities designed to identify vulnerabilities, exploit systems, or monitor
activities within a network. These tools can be used for ethical purposes (e.g., penetration testing) or malicious
purposes (e.g., cyberattacks).
Example: Metasploit
Usage:
o Automate the process of identifying and exploiting system vulnerabilities.
Purpose:
o Ethical: Simulate real-world attacks to evaluate defenses.
o Non-Ethical: Exploit system weaknesses to compromise data.
Example: Wireshark
Usage:
o Monitor and analyze network traffic.
Purpose:
o Ethical: Detect malicious activity or debug network issues.
o Non-Ethical: Intercept sensitive data like passwords or session tokens.
Example: Msfvenom
Usage:
o Create custom payloads for penetration testing.
Purpose:
o Ethical: Test anti-malware defenses.
o Non-Ethical: Create viruses or Trojans to compromise systems.
Example: Aircrack-ng
Usage:
o Crack Wi-Fi encryption (e.g., WEP, WPA, WPA2).
Purpose:
o Ethical: Test wireless network security.
o Non-Ethical: Gain unauthorized access to networks.
1.8 Social Engineering Tools
1.9 Rootkits
Usage:
o Conceal unauthorized access or malware.
Purpose:
o Ethical: Test systems for detection capabilities.
o Non-Ethical: Maintain long-term access to compromised systems.
Ethical hacking, also known as penetration testing or white-hat hacking, involves authorized attempts to
discover and fix security vulnerabilities. It plays a vital role in strengthening cybersecurity.
1. Authorization:
o Performed with the explicit consent of the system owner.
2. Objective:
o Protect systems, networks, and data from malicious attacks.
3. Process:
o Identify vulnerabilities, report findings, and recommend fixes.
Non-ethical hacking, also known as black-hat hacking, involves unauthorized access to systems for malicious
purposes. It violates privacy, disrupts operations, and often leads to financial or reputational damage.
1. Illegal Activity:
oPerformed without permission from the system owner.
2. Objective:
o Steal data, extort money, or disrupt services.
3. Consequences:
o Can result in criminal charges, financial losses, and damage to critical infrastructure.
Conclusion
Hacking tools are powerful assets that can be used for both ethical and malicious purposes. Ethical hacking
plays a crucial role in strengthening cybersecurity, protecting systems, and building trust in the digital
ecosystem. However, the misuse of hacking tools for non-ethical purposes highlights the need for strict
regulations, continuous education, and professional accountability to mitigate cyber threats and ensure a safer
internet.
In today’s digital age, protecting systems, networks, and data from cyberattacks is a critical aspect of
cybersecurity. Hack prevention tools are designed to thwart potential breaches, while recovery tools help
mitigate the damage and restore normalcy after a cyberattack. These tools are crucial for maintaining data
integrity, business continuity, and organizational reputation.
1. Hack Prevention Tools
Hack prevention tools proactively defend systems and networks against malicious activities by identifying,
blocking, and mitigating security threats.
1.1 Firewalls
Description: Hardware or software tools that monitor and control incoming and outgoing traffic based
on predefined security rules.
Purpose:
o Block unauthorized access.
o Protect against network-based attacks.
Examples: Cisco ASA, pfSense, Windows Defender Firewall.
Description: Tools designed to detect and remove malicious software such as viruses, worms, and
spyware.
Purpose:
o Prevent malware infections.
o Scan files and programs in real-time.
Examples: Norton Antivirus, Kaspersky, Malwarebytes.
Description: Tools that monitor network traffic for suspicious activities and respond to identified
threats.
Purpose:
o Detect unauthorized access attempts.
o Automatically block malicious activities.
Examples: Snort, Suricata, Palo Alto Networks.
Description: Solutions that secure endpoints such as laptops, desktops, and mobile devices.
Purpose:
o Prevent unauthorized device access.
o Protect sensitive data stored on endpoints.
Examples: CrowdStrike, Symantec Endpoint Protection, Bitdefender.
Description: Tools that require users to verify their identity using multiple factors, such as passwords
and biometrics.
Purpose:
o Strengthen access control mechanisms.
o Prevent unauthorized access even if passwords are compromised.
Examples: Duo Security, Google Authenticator, Microsoft Authenticator.
Description: Software that secures data by converting it into an unreadable format, accessible only with
a decryption key.
Purpose:
o Protect sensitive data during transmission and storage.
o Prevent data breaches.
Examples: VeraCrypt, AxCrypt, BitLocker.
Description: Tools that protect against phishing, spam, and email-based malware.
Purpose:
o Secure communication channels.
o Block malicious attachments and links.
Examples: Mimecast, Proofpoint, Barracuda Email Security.
Recovery tools are used to respond to security breaches, minimize damage, and restore systems to normal
operation.
Description: Tools that help investigate breaches by collecting and analyzing digital evidence.
Purpose:
o Determine the scope and origin of attacks.
o Support legal action if necessary.
Examples: Autopsy, EnCase, FTK (Forensic Toolkit).
Description: Tools that automate the process of applying security patches and updates.
Purpose:
o Fix vulnerabilities exploited during the attack.
o Prevent recurrence of similar incidents.
Examples: SolarWinds Patch Manager, ManageEngine Patch Manager Plus.
1. Sophistication of Attacks:
o Advanced persistent threats (APTs) and zero-day exploits are difficult to prevent.
2. Human Error:
o Negligence or lack of awareness among users increases risks.
3. Resource Constraints:
o Small organizations may lack the budget or expertise for robust cybersecurity.
4. Complex Environments:
o Multi-cloud and hybrid setups can complicate prevention and recovery efforts.
Conclusion
Hack prevention and recovery tools are essential components of a comprehensive cybersecurity strategy.
Prevention tools like firewalls, antivirus software, and vulnerability scanners proactively guard against threats,
while recovery tools like backup solutions and forensic platforms help organizations recover swiftly after an
attack. By combining these tools with best practices, organizations can minimize risks and ensure resilience in
the face of evolving cyber threats.
Cryptography is the practice of securing communication and data through the use of algorithms. Cryptographic
functions like hashing, encryption, and decryption are fundamental to secure applications. In various
programming languages like PHP, Python, JavaScript, and C, there are built-in libraries and methods that
facilitate the use of cryptography. This discussion focuses on the use of cryptographic modules in these
languages, specifically the MD4(), MD5(), and Encrypt() functions.
MD4 (Message Digest Algorithm 4): A cryptographic hash function that produces a 128-bit hash value.
It was designed by Ronald Rivest in 1990. MD4 is considered broken and insecure because
vulnerabilities have been discovered in its algorithm, allowing for collision attacks.
MD5 (Message Digest Algorithm 5): A widely used cryptographic hash function that also produces a
128-bit hash value. It was designed by Ronald Rivest in 1991 and has been widely used in verifying the
integrity of files. However, MD5 is now considered broken and unsuitable for cryptographic security
due to vulnerabilities allowing collision attacks.
Although both MD4 and MD5 are insecure for use in cryptographic security today, they are still sometimes
used for checksums or non-cryptographic purposes (like file integrity checks).
In PHP, both MD4 and MD5 are supported natively through functions like md4() and md5(). These
functions generate a hash of a given input string.
Example: Using MD5 in PHP:
$data = "Hello World";
$hash_md5 = md5($data);
echo $hash_md5; // Outputs: fc3ff98e8c6a0d3087d515c0473f8677
o Note: MD4 is not directly supported in PHP, but MD5 can be used in a similar manner.
Python
o MD4 is not natively supported by the hashlib library, but external libraries or manual
implementation can be used.
JavaScript
JavaScript doesn't have a native MD5() function, but libraries like CryptoJS can be used to implement
MD5 hashing.
Example: Using MD5 in JavaScript (via CryptoJS):
const CryptoJS = require("crypto-js");
const data = "Hello World";
const hash_md5 = CryptoJS.MD5(data).toString(CryptoJS.enc.Hex);
console.log(hash_md5); // Outputs: fc3ff98e8c6a0d3087d515c0473f8677
In C, MD5 can be implemented using the OpenSSL library or other libraries like libcrypto.
Example: Using MD5 in C (with OpenSSL):
#include <stdio.h>
#include <string.h>
#include <openssl/md5.h>
int main() {
unsigned char result[MD5_DIGEST_LENGTH];
char data[] = "Hello World";
MD5_CTX mdContext;
MD5_Init(&mdContext);
MD5_Update(&mdContext, data, strlen(data));
MD5_Final(result, &mdContext);
printf("MD5 hash: ");
for (int i = 0; i < MD5_DIGEST_LENGTH; i++) {
printf("%02x", result[i]);
}
printf("\n");
return 0;
}
2. Encrypt() Function
The Encrypt() function is typically used for symmetric encryption (e.g., AES, DES, etc.) and sometimes for
asymmetric encryption in various programming languages. It encrypts plaintext using a key and produces
ciphertext, which can only be decrypted with the correct key.
PHP
Python
Python's pycryptodome library allows encryption using algorithms like AES, DES, etc.
Example: Using AES encryption in Python:
from Crypto.Cipher import AES
from Crypto.Util.Padding import pad, unpad
from Crypto.Random import get_random_bytes
JavaScript
JavaScript encryption is available via the Web Crypto API or libraries like CryptoJS.
Example: Using AES encryption in JavaScript (via CryptoJS):
const CryptoJS = require("crypto-js");
const data = "Hello World";
const key = "secretkey";
In C, libraries like OpenSSL allow for encryption via AES, DES, and other ciphers.
Example: Using AES encryption in C (via OpenSSL):
#include <stdio.h>
#include <openssl/aes.h>
int main() {
AES_KEY enc_key;
unsigned char key[16] = "secretkey123456";
unsigned char data[16] = "Hello World";
unsigned char enc_out[16];
MD4 and MD5 are cryptographic hash functions that produce a fixed-size output (128-bit hash). They
are fast but vulnerable to collision attacks and are not recommended for security-sensitive applications
today.
The Encrypt() function is used for symmetric encryption and can be implemented in various languages
using libraries like OpenSSL, CryptoJS, or pycryptodome. This function uses a key to encrypt data into
ciphertext and is widely used for data confidentiality.
It is important to note that while MD4 and MD5 may still be used for integrity checks and non-critical
applications, they are not suitable for cryptographic security. For modern encryption, algorithms like AES
(Advanced Encryption Standard) are recommended.
References:
1. Ron Massas October 22, 2024. Sarrit omri Daniel, September 30, 2024.