Coder Social home page Coder Social logo

rabestro / error-correcting-encoder-decoder Goto Github PK

View Code? Open in Web Editor NEW
1.0 3.0 0.0 380 KB

Implementation of education project from JetBrains Academy. Project description: https://hyperskill.org/projects/58/stages/316/implement

Home Page: https://rabestro.github.io/error-correcting-encoder-decoder/

Java 51.46% Groovy 48.54%
hamming-code error-correction-codes error-correction hyperskill console-application

error-correcting-encoder-decoder's Introduction

About

Errors are inevitable both in life and in the digital world. Errors occur here and there and everywhere, and in this project we will not only imitate this process, but also learn how to cope with errors. It is a chance to experience what early developers had to cope with at the dawn of the computer era. Low-level programming is fun and insightful: try it and you’ll see.

Learning outcomes

Gain a more profound understanding of essential basics and figure out bytes bit by bit. Practice loops and working with files.

How to run

asciicast

Generated reports

error-correcting-encoder-decoder's People

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

error-correcting-encoder-decoder's Issues

Bit-level error emulator

Story

In real telecommunication, errors occur on a bit level, that's why we should learn how to deal with them. Now, instead of doing one error every three bytes, the program on this stage should make an error in one bit per byte. So, every byte would be corrupted, but in a small way.

For example, let's take the symbol 'A'. In binary, it would be 01000001. If we make an error in a single bit, it would look something like 01010001 or 00000001 or 11000001, making it a completely different symbol, but in binary very close to the symbol 'A'. By the way, you can see all binary and hexadecimal representations of the standard symbols here.

Objective

In this stage, you should write a program that reads the text the user wants to send from the send.txt, and simulate the sending through a poor internet connection making one-bit errors in every byte of the text. Notice that this text is no longer a string since after manipulations in every byte it may happen to be that some bytes didn't correspond to a specific character in the table because Java does not use ASCII table representation in their String implementation. Java uses UNICODE that happens to match with ASCII in the first 128 symbols, but no further. The String class is too complicated for low-level manipulations so you should use bytes or chars instead.

The received message which contains an error in a single bit in every byte should be saved into received.txt.

Also to work with this file in a hex format, you need a DeltaHex Editor. It's a plugin for IntelliJ IDEA.

Make sure that using this pseudorandom number generator is safe here

Weak Cryptography

Class: src/main/java/lv/id/jc/correcter/coder/ErrorEmulator.java

Description

Using pseudorandom number generators (PRNGs) is security-sensitive. For example, it has led in the past to the following vulnerabilities:

CVE-2013-6386
CVE-2006-3419
CVE-2008-4102
When software generates predictable values in a context requiring unpredictability, it may be possible for an attacker to guess the next value that will be generated, and use this guess to impersonate another user or access sensitive information.

As the java.util.Random class relies on a pseudorandom number generator, this class and relating java.lang.Math.random() method should not be used for security-critical applications or for protecting sensitive data. In such context, the java.security.SecureRandom class which relies on a cryptographically strong random number generator (RNG) should be used in place.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.