https://github.com/charafzellou/golang-crypto-validator
A small server-client app to practice hashing and encryption in Go
https://github.com/charafzellou/golang-crypto-validator
Last synced: about 2 months ago
JSON representation
A small server-client app to practice hashing and encryption in Go
- Host: GitHub
- URL: https://github.com/charafzellou/golang-crypto-validator
- Owner: charafzellou
- License: agpl-3.0
- Created: 2024-07-24T22:59:34.000Z (11 months ago)
- Default Branch: main
- Last Pushed: 2024-07-25T09:24:47.000Z (11 months ago)
- Last Synced: 2025-02-16T03:47:23.702Z (4 months ago)
- Language: Go
- Homepage:
- Size: 28.3 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Cryptography Challenge in Go
## Overview
In this exercise, you will implement a client application that interacts with a secure server to complete a series of cryptographic challenges.The goal is to reinforce your understanding of fundamental cryptographic concepts while simulating real-world secure communication protocols.
## Objectives
By the end of this challenge, you should be able to:
1. Implement basic cryptographic operations (hashing and encryption)
2. Interact with a RESTful API using secure protocols
3. Handle and respond to time-sensitive cryptographic challenges
4. Manage a simple score-based system in a competitive environment## The Challenge
You are tasked with creating a client application that communicates with a provided server.The server will issue two types of cryptographic challenges: hash challenges and encryption challenges. Your client must solve these challenges correctly to earn points.
### Server Endpoints
The server provides the following endpoints:1. `/subscribe` (POST): Register your client with the server
2. `/info/{address}` (GET): Retrieve your current score and information
3. `/challenge/hash/{address}` (GET): Request a SHA256 hash challenge
4. `/challenge/hash/{address}/{challengeID}` (POST): Submit a SHA256 hash challenge solution
5. `/challenge/encrypt/{address}` (GET): Request a RSA encryption challenge
6. `/challenge/encrypt/{address}/{challengeID}` (POST): Submit a RSA encryption challenge solution### Challenge Types
1. **Hash Challenge**:
- The server provides a random sentence.
- Your task is to compute the SHA256 hash of the sentence and submit it back to the server.2. **Encryption Challenge**:
- The server provides a random sentence and a public key.
- Your task is to encrypt the sentence using the provided RSA public key and submit the RSA ciphertext back to the server.### Scoring
- Each successful challenge completion earns you 1 point.
- Each failed attempt results in a 3-point deduction.
- The first student to reach a score of 30 wins a bonus.## Requirements
1. Implement a client application in a programming language of your choice.
2. Your client should be able to:
- Subscribe to the server with a valid Ethereum address and name
- Request and solve both hash and encryption challenges
- Handle errors gracefully and continue functioning
- Retrieve current score information
3. Implement proper error handling and logging in your client application.
4. Ensure your client can handle concurrent challenges and maintain a consistent state.## Bonus Challenges
For extra credit, consider implementing the following features:
1. A user interface to display current score and challenge status
2. Automatic retrying of failed challenges with exponential backoff
3. Implementation of additional cryptographic algorithms beyond those required## Submission
Submit your client application code along with a brief report describing:
1. Your implementation approach
2. Any challenges you faced and how you overcame them
3. Potential improvements or optimizations you would make with more timeGood luck, and may the best cryptographer win!