Skip to content

Commit 48d2c12

Browse files
authored
Merge branch 'main' into glowing-cursor
2 parents 02c0d9b + 48b6c55 commit 48d2c12

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+4011
-62
lines changed

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
contact_links:
2+
- name: CodeHarborHub Q&A
3+
url: https://codeharborhub.github.io/community/supports#-how-to-get-support
4+
about: Get help from the community with any questions or issues.
5+
6+
- name: CodeHarborHub Features
7+
url: https://codeharborhub.github.io/community/features
8+
about: Explore the features and capabilities of CodeHarborHub.
9+
10+
- name: Meet the Founder or Owner
11+
url: https://codeharborhub.github.io/me/
12+
about: Learn more about the founder and owner of CodeHarborHub.
Loading
Loading
Loading
Loading
Loading
Loading
Loading

blog/Building RESTful CRUD API in springboot/index.md

Lines changed: 571 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
---
2+
title: 'Cryptography and Its Use in Cyber Security'
3+
sidebar_label: Cryptography and Cyber Security
4+
authors: [pujan-sarkar]
5+
tags: [cryptography, cyber security, encryption, technology]
6+
date: 2024-06-24
7+
hide_table_of_contents: true
8+
---
9+
10+
## Introduction
11+
12+
In the realm of cyber security, cryptography stands as a critical tool for protecting information. As digital data exchange grows exponentially, the importance of cryptography in ensuring data security and privacy cannot be overstated. This blog explores the fundamental concepts of cryptography, its historical significance, and its contemporary applications in cyber security.
13+
14+
## Understanding Cryptography
15+
16+
Cryptography is the science of encoding and decoding information to protect it from unauthorized access. It involves various techniques and algorithms that transform readable data, known as plaintext, into an unreadable format, known as ciphertext. Only those who possess the appropriate decryption key can convert the ciphertext back into plaintext.
17+
18+
### Key Concepts in Cryptography
19+
20+
1. **Encryption and Decryption**: The process of converting plaintext into ciphertext is called encryption, while the process of converting ciphertext back into plaintext is called decryption.
21+
2. **Symmetric Key Cryptography**: The same key is used for both encryption and decryption. Examples include AES and DES.
22+
3. **Asymmetric Key Cryptography**: Uses a pair of keys - a public key for encryption and a private key for decryption. Examples include RSA and ECC.
23+
4. **Hash Functions**: Take an input and produce a fixed-size string of characters, which is typically a hash value. Hash functions are used for data integrity and password storage.
24+
25+
## Historical Significance of Cryptography
26+
27+
Cryptography has been used for centuries to secure communication. Some historical milestones include:
28+
29+
- **Caesar Cipher**: Used by Julius Caesar to protect military messages, this substitution cipher shifts letters by a fixed number of positions in the alphabet.
30+
- **Enigma Machine**: Used by the Germans during World War II, this electromechanical device encrypted messages. The successful decryption of Enigma-encrypted messages by the Allies significantly impacted the war's outcome.
31+
- **Diffie-Hellman Key Exchange**: Introduced in 1976, this method allowed secure key exchange over a public channel, laying the groundwork for modern public-key cryptography.
32+
33+
## Cryptography in Modern Cyber Security
34+
35+
In today's digital world, cryptography is essential for securing data and maintaining privacy. Its applications are vast and varied:
36+
37+
### Secure Communication
38+
39+
Cryptography ensures that communication between parties remains confidential and secure. Protocols like SSL/TLS use cryptographic techniques to protect data transmitted over the internet, such as during online banking and shopping.
40+
41+
### Data Integrity
42+
43+
Hash functions play a crucial role in ensuring data integrity. When data is transmitted or stored, hash functions can verify that the data has not been altered. This is particularly important for software distribution and digital signatures.
44+
45+
### Authentication
46+
47+
Cryptographic methods are used to verify the identities of users and devices. Passwords are typically stored as hash values, and public-key infrastructure (PKI) systems use digital certificates to authenticate entities.
48+
49+
### Blockchain Technology
50+
51+
Cryptography is the backbone of blockchain technology. Cryptographic hashing ensures the integrity of data blocks, while asymmetric cryptography secures transactions and verifies identities. This technology underpins cryptocurrencies like Bitcoin and has applications in various fields, including supply chain management and healthcare.
52+
53+
### Secure Storage
54+
55+
Encrypting data at rest ensures that even if unauthorized individuals gain access to storage media, they cannot read the data without the decryption key. This is crucial for protecting sensitive information on devices and in cloud storage.
56+
57+
## Challenges in Cryptography
58+
59+
While cryptography is a powerful tool, it is not without challenges:
60+
61+
- **Key Management**: Securely generating, storing, and distributing cryptographic keys is complex and critical for maintaining security.
62+
- **Performance Overheads**: Cryptographic operations can be computationally intensive, affecting system performance, especially in resource-constrained environments.
63+
- **Quantum Computing**: Emerging quantum computers have the potential to break many of the cryptographic algorithms currently in use, necessitating the development of quantum-resistant algorithms.
64+
65+
## Future Directions in Cryptography
66+
67+
The field of cryptography is continuously evolving to address emerging threats and challenges. Some future directions include:
68+
69+
### Post-Quantum Cryptography
70+
71+
With the advent of quantum computing, researchers are developing cryptographic algorithms that are resistant to quantum attacks. These algorithms aim to provide security even in the presence of powerful quantum computers.
72+
73+
### Homomorphic Encryption
74+
75+
This advanced form of encryption allows computations to be performed on encrypted data without decrypting it. Homomorphic encryption has significant implications for data privacy, particularly in cloud computing and data analysis.
76+
77+
### Zero-Knowledge Proofs
78+
79+
Zero-knowledge proofs enable one party to prove to another that a statement is true without revealing any information beyond the validity of the statement. This concept has applications in authentication, privacy-preserving protocols, and blockchain technology.
80+
81+
## Conclusion
82+
83+
Cryptography is a cornerstone of cyber security, providing the means to protect data and maintain privacy in an increasingly interconnected world. As technology advances and new threats emerge, the field of cryptography will continue to evolve, offering innovative solutions to ensure the security and integrity of our digital lives. By understanding and implementing cryptographic techniques, individuals and organizations can safeguard their information and build a secure future.
84+

docs/SQL/SQL-NOT-Operator.md

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
---
2+
id: sql-not-operator
3+
title: Not Operator in SQL
4+
sidebar_label: Not Operator
5+
sidebar_position: 5
6+
tags: [sql, database, operator]
7+
description: In this tutorial, you will learn how to build queries with Negations to get the desired output.
8+
---
9+
10+
11+
In SQL, the NOT operator is used to negate a condition in a WHERE clause or other SQL statement. Its primary function is to reverse the logical meaning of the condition that follows it.
12+
13+
## Syntax
14+
```sql
15+
SELECT column1, column2, ...
16+
FROM table_name
17+
WHERE NOT condition;
18+
19+
```
20+
21+
## Advantages of SQL NOT Operator
22+
23+
**1.Exclusion of Unwanted Records:**
24+
- The NOT operator allows you to exclude records that match a certain condition. This is useful when you need to filter out specific data from your results.
25+
26+
**2.Simplification of Complex Conditions:**
27+
- It simplifies the writing of complex conditions by directly specifying what should not be included. Without the NOT operator, you might have to write more convoluted logic.
28+
29+
**3.Enhanced Readability and Maintainability:**
30+
- Using NOT can make the intention of the query clearer to someone reading the SQL code. Clearer code is easier to maintain and less prone to errors.
31+
32+
**4.Combination with Other Operators:**
33+
- The NOT operator can be combined with other operators such as IN, BETWEEN, and LIKE to provide more nuanced data filtering.
34+
35+
**5.Handling NULL Values:**
36+
- The NOT operator can also be used effectively with IS NULL or IS NOT NULL to filter out or include rows with NULL values.
37+
38+
**6.Flexibility in Subqueries:**
39+
- When used with subqueries, the NOT operator can help exclude sets of records efficiently.
40+
41+
**7.Versatility in Logical Expressions:**
42+
- It can be used to invert the result of any logical expression, providing versatility in query construction.
43+
44+
## Examples of Not Operator in SQL
45+
46+
### NOT LIKE
47+
```sql
48+
SELECT * FROM Customers
49+
WHERE CustomerName NOT LIKE 'A%';
50+
```
51+
52+
### NOT BETWEEN
53+
```sql
54+
SELECT * FROM Customers
55+
WHERE CustomerID NOT BETWEEN 10 AND 60;
56+
```
57+
58+
### NOT IN
59+
```sql
60+
SELECT * FROM Customers
61+
WHERE City NOT IN ('Paris', 'London');
62+
```
63+
64+
### NOT Greater Than
65+
```sql
66+
SELECT * FROM Customers
67+
WHERE NOT CustomerID > 50;
68+
```
69+
70+
### NOT Less Than
71+
```sql
72+
SELECT * FROM Customers
73+
WHERE NOT CustomerId < 50;
74+
```
75+
76+
77+
## Conclusion
78+
The NOT operator in SQL provides a straightforward way to negate conditions in SQL queries, allowing for more flexible and precise data retrieval. Understanding its usage is crucial for crafting effective SQL statements, particularly when dealing with complex filtering requirements.
79+
80+
---
81+
82+
## Authors:
83+
84+
<div style={{display: 'flex', flexWrap: 'wrap', justifyContent: 'space-between', gap: '10px'}}>
85+
{['damini-chachane'].map(username => (
86+
<Author key={username} username={username} />
87+
))}
88+
</div>

docs/dsa/algorithms/image-8.png

25.3 KB
Loading
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
---
2+
id: patternsearching-in-dsa
3+
title: Pattern Searching Algorithm in Data Structures and Algorithms
4+
sidebar_label: Pattern Searching Algorithm
5+
sidebar_position: 7
6+
description: "The Pattern Searching Algorithm is a powerful tool used to find occurrences of a pattern within a larger text or string."
7+
tags: [dsa,data-algorithms , pattern-searching]
8+
---
9+
10+
11+
The Pattern Searching Algorithm is a powerful tool used to find occurrences of a pattern within a larger text or string. It is commonly employed in string matching problems, where the goal is to search for a specific pattern or substring within a given text.
12+
13+
![pattern search](image-8.png)
14+
15+
This algorithm compares the pattern with each possible substring of the text, starting from the leftmost position. When a match is found, the algorithm reports the index or position of the match. There are several variations of the Pattern Searching Algorithm, including the Naive Pattern Searching Algorithm, Knuth-Morris-Pratt (KMP) Algorithm, Rabin-Karp Algorithm, and Boyer-Moore Algorithm, each with its own advantages and disadvantages.
16+
17+
### Advantages of the Pattern Searching Algorithm:
18+
19+
1. Versatility: The algorithm can be applied to various string matching problems, making it a valuable tool in many applications.
20+
2. Flexibility: Different variations of the algorithm allow for different trade-offs in terms of time complexity, space complexity, and implementation complexity.
21+
3. Efficiency: Depending on the specific variation used, the Pattern Searching Algorithm can achieve efficient search times, particularly in large texts.
22+
23+
### Disadvantages of the Pattern Searching Algorithm:
24+
25+
1. Complexity: Some variations of the algorithm can be complex to understand and implement, especially for beginners.
26+
2. Performance: The performance of the algorithm can vary depending on the specific variation used and the characteristics of the input text and pattern. In some cases, the algorithm may not be the most efficient solution.
27+
28+
Here's an example code problem to illustrate the usage of the Pattern Searching Algorithm:
29+
30+
```python
31+
```python
32+
def pattern_search(text, pattern):
33+
result = []
34+
text_length = len(text)
35+
pattern_length = len(pattern)
36+
37+
for i in range(text_length - pattern_length + 1):
38+
j = 0
39+
while j < pattern_length:
40+
if text[i + j] != pattern[j]:
41+
break
42+
j += 1
43+
if j == pattern_length:
44+
result.append(i)
45+
46+
return result
47+
48+
text = "ABABDABACDABABCABAB"
49+
pattern = "ABABC"
50+
matches = pattern_search(text, pattern)
51+
print("Pattern found at positions:", matches)
52+
```
53+
54+
In this example, we have a text string "ABABDABACDABABCABAB" and we want to search for the pattern "ABABC" within it. The `patternSearch` function implements the Naive Pattern Searching Algorithm. It iterates through the text, comparing each substring of the same length as the pattern with the pattern itself. If a match is found, the starting position of the match is added to the result array. Finally, the function returns the array of positions where the pattern was found.
55+
56+
When we run this code, it will output: "Pattern found at positions: [0, 10]". This means that the pattern "ABABC" was found at positions 0 and 10 within the text string.
57+
58+
59+
The pattern search algorithm, also known as the Naive Pattern Searching Algorithm, is a simple and straightforward approach to finding occurrences of a pattern within a text string. It works by iterating through the text and comparing each substring of the same length as the pattern with the pattern itself.
60+
61+
The algorithm starts by initializing an empty array to store the positions where the pattern is found. Then, it iterates through the text string, comparing each substring of the same length as the pattern with the pattern itself. If a match is found, the starting position of the match is added to the result array.
62+
63+
Once the algorithm has finished iterating through the entire text, it returns the array of positions where the pattern was found. This allows us to determine the locations of all occurrences of the pattern within the text.
64+
65+
The Naive Pattern Searching Algorithm is relatively simple to implement and understand, making it a good starting point for pattern searching tasks. However, it has a time complexity of O((n-m+1)*m), where n is the length of the text and m is the length of the pattern. This means that the algorithm's performance can degrade for large texts or patterns.
66+
67+
There are more advanced pattern searching algorithms, such as the Knuth-Morris-Pratt (KMP) algorithm and the Boyer-Moore algorithm, which offer better time complexity and improved performance in certain scenarios. However, the Naive Pattern Searching Algorithm serves as a foundation for understanding pattern searching concepts and can be a useful starting point for simple cases.

docs/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ title: Welcome to CodeHarborHub Tutorials
44
sidebar_label: Welcome to CodeHarborHub
55
sidebar_position: 1
66
slug: /
7+
sidebar_class_name: "tutorial-learning-tasks"
78
---
89

910
Hello, and welcome to CodeHarborHub! Our mission is to provide accessible and comprehensive educational resources to learners of all levels, from beginners to advanced professionals. Whether you're looking to kickstart your career in web development, master a new programming language, or stay updated on the latest tech trends, we've got you covered.

0 commit comments

Comments
 (0)