The Security Printing Corporation (Bangladesh) Ltd.
Post: Sub-Assistant programmer,
Exam Date: 15-01-2022
Blacklist
A Blacklist is a list of users, IP addresses, websites, or applications that are explicitly blocked from accessing a system or network.
Whitelist
A Whitelist is a list of users, IP addresses, websites, or applications that are explicitly allowed to access a system or network. Everything else is blocked by default.
Difference between Blacklist and Whitelist
- Access Rule: Blacklist blocks specific entities; Whitelist allows only specific entities.
- Default Behavior: Blacklist allows all except blocked ones; Whitelist blocks all except allowed ones.
- Security Level: Blacklist is less secure; Whitelist is more secure.
- Use Case: Blacklist is used to block known threats; Whitelist is used in high-security environments.
Blacklist
Blacklist হলো এমন একটি তালিকা যেখানে নির্দিষ্ট user, IP address, website বা application-কে block করে রাখা হয় যাতে তারা system বা network access না পায়।
Whitelist
Whitelist হলো এমন একটি তালিকা যেখানে শুধুমাত্র নির্দিষ্ট user, IP address, website বা application-কে allow করা হয়। তালিকার বাইরে থাকা সবকিছু block থাকে।
Blacklist এবং Whitelist-এর পার্থক্য
- Access Rule: Blacklist নির্দিষ্ট entity block করে; Whitelist নির্দিষ্ট entity allow করে।
- Default Behavior: Blacklist-এ সব allow থাকে শুধু blocked ছাড়া; Whitelist-এ সব block থাকে শুধু allowed ছাড়া।
- Security Level: Blacklist তুলনামূলক কম secure; Whitelist বেশি secure।
- Use Case: Blacklist পরিচিত threat block করতে ব্যবহৃত হয়; Whitelist উচ্চ security পরিবেশে ব্যবহৃত হয়।
Difference between Exception and Error in Java
- Meaning: Exception represents conditions that a program can handle; Error represents serious problems that a program cannot handle.
- Recovery: Exceptions can be caught and handled using try-catch; Errors are generally not recoverable.
- Cause: Exceptions occur due to logical issues or user input; Errors occur due to system-level failures.
- Examples: Exception – NullPointerException, ArithmeticException; Error – OutOfMemoryError, StackOverflowError.
- Package: Both belong to java.lang package, but Error is not meant to be handled.
Java-তে Exception এবং Error-এর পার্থক্য
- অর্থ: Exception হলো এমন সমস্যা যা program handle করতে পারে; Error হলো গুরুতর সমস্যা যা program handle করতে পারে না।
- Recovery: Exception try-catch দিয়ে handle করা যায়; Error সাধারণত recover করা যায় না।
- কারণ: Exception হয় logical সমস্যা বা ভুল input-এর কারণে; Error হয় system-level failure-এর কারণে।
- উদাহরণ: Exception – NullPointerException, ArithmeticException; Error – OutOfMemoryError, StackOverflowError।
- Package: দুটোই java.lang package-এর অন্তর্ভুক্ত, তবে Error handle করার জন্য নয়।
Exception Handling
Exception handling is a mechanism used in programming to handle runtime errors so that the normal flow of the program is not interrupted. It helps detect errors and provides a way to recover from them.
Example (Java):
try {
int a = 10;
int b = 0;
int c = a / b;
System.out.println(c);
} catch (ArithmeticException e) {
System.out.println("Division by zero is not allowed");
}
Here, the exception is caught and handled instead of crashing the program.
Exception Handling
Exception handling হলো programming-এর একটি পদ্ধতি যেখানে runtime error ঘটলে তা handle করা হয়, যাতে program হঠাৎ বন্ধ না হয়ে যায় এবং স্বাভাবিকভাবে চলতে পারে।
উদাহরণ (Java):
try {
int a = 10;
int b = 0;
int c = a / b;
System.out.println(c);
} catch (ArithmeticException e) {
System.out.println("Division by zero is not allowed");
}
এখানে error ঘটলেও program বন্ধ না হয়ে error message দেখায়।
SQL Injection
SQL Injection is a web security vulnerability where an attacker inserts malicious SQL code into a query to manipulate or access the database without authorization. It can lead to data theft, data modification, or complete database compromise.
How to Prevent SQL Injection
- Use Prepared Statements: Parameterized queries prevent malicious SQL execution.
- Input Validation: Validate and sanitize user inputs.
- Use Stored Procedures: Reduces direct SQL execution.
- Limit Database Privileges: Use least-privilege principle.
- Web Application Firewall (WAF): Blocks common SQL injection patterns.
SQL Injection
SQL Injection হলো একটি web security vulnerability যেখানে attacker malicious SQL code ব্যবহার করে database-এ unauthorized access পায়। এতে data চুরি, পরিবর্তন বা database সম্পূর্ণ নষ্ট হয়ে যেতে পারে।
SQL Injection প্রতিরোধের উপায়
- Prepared Statement ব্যবহার: Parameterized query malicious SQL execute হতে দেয় না।
- Input Validation: User input যাচাই ও sanitize করা।
- Stored Procedure ব্যবহার: Direct SQL execution কমায়।
- Database Privilege সীমিত করা: Least privilege নীতি অনুসরণ করা।
- Web Application Firewall (WAF): SQL injection attack block করে।
Cross-Site Scripting (XSS)
XSS (Cross-Site Scripting) is a web security vulnerability where an attacker injects malicious scripts into trusted websites. These scripts run in the victim’s browser and can steal sensitive information like cookies, session tokens, or redirect users to malicious sites.
How to Fix / Prevent XSS
- Input Validation: Validate and sanitize all user inputs.
- Output Encoding: Encode data before displaying it on web pages.
- Use Security Headers: Implement Content Security Policy (CSP).
- Avoid Inline Scripts: Reduce use of inline JavaScript.
- Use Secure Frameworks: Modern frameworks handle XSS automatically.
Cross-Site Scripting (XSS)
XSS (Cross-Site Scripting) হলো একটি web security vulnerability যেখানে attacker একটি trusted website-এ malicious script inject করে। এই script user-এর browser-এ execute হয় এবং cookie, session information চুরি করতে পারে বা malicious site-এ redirect করতে পারে।
XSS প্রতিরোধের উপায়
- Input Validation: User input যাচাই ও sanitize করা।
- Output Encoding: Web page-এ দেখানোর আগে data encode করা।
- Security Header ব্যবহার: Content Security Policy (CSP) প্রয়োগ করা।
- Inline Script এড়ানো: Inline JavaScript কম ব্যবহার করা।
- Secure Framework ব্যবহার: আধুনিক framework XSS handle করতে সাহায্য করে।
DBMS (Database Management System)
A DBMS is software that is used to create, store, manage, and retrieve data efficiently from a database. It provides an interface between users/applications and the database.
Virtual Memory
Virtual memory is a memory management technique that uses a part of secondary storage (hard disk) as an extension of main memory (RAM). It allows programs to run even if the physical memory is insufficient.
Cache Memory
Cache memory is a small, high-speed memory located between the CPU and main memory. It stores frequently accessed data and instructions to improve system performance.
DBMS (Database Management System)
DBMS হলো এমন একটি software যা database তৈরি, সংরক্ষণ, পরিচালনা এবং data retrieve করার জন্য ব্যবহৃত হয়। এটি user/application এবং database-এর মধ্যে interface হিসেবে কাজ করে।
Virtual Memory
Virtual memory হলো একটি memory management technique যেখানে secondary storage (hard disk)-এর একটি অংশ main memory (RAM)-এর মতো ব্যবহার করা হয়। এতে physical memory কম হলেও program চলতে পারে।
Cache Memory
Cache memory হলো CPU এবং main memory-এর মাঝখানে থাকা একটি ছোট ও দ্রুতগতির memory। এটি বারবার ব্যবহৃত data ও instruction সংরক্ষণ করে system performance বাড়ায়।
