Git Product home page Git Product logo

codecheck-1904's Introduction

rijndael

Rijndael, commonly referred to as the Advanced Encryption Standard (AES), is a specification for encrypting data. Solve the challenge to implement this cipher and pass tests.

Challenge Description

Step 1: Encryption

Create your encrypt function in app.js under encrypt. This function will be called from the test cases with the following parameters;

  • byte
  • The data to encrypt as an array of bytes.
  • key
  • The key to use for the encryption, as an array of bytes. The function should return the encrypted data as an array of bytes.

Encrypt

# Key input Data input Expected output
1 2b7e151628aed2a6abf7158809cf4f3c 3243f6a8885a308d313198a2e0370734 3925841d02dc09fbdc118597196a0b32
2 2b7e151628aed2a6abf7158809cf4f3c762e7160f38b4da5 3243f6a8885a308d313198a2e0370734 f9fb29aefc384a250340d833b87ebc00
3 2b7e151628aed2a6abf7158809cf4f3c762e7160f38b4da56a784d9045190cfe 3243f6a8885a308d313198a2e0370734 1a6e6c2c662e7da6501ffb62bc9e93f3

Step 2: Decryption

Create your decrypt function in app.js under decrypt. This function will be called from the test cases with the following parameters;

  • byte
  • The data to decrypt as an array of bytes.
  • key
  • The key to use for the decryption, as an array of bytes.

The function should return the decrypted data as an array of bytes.

Decrypt

# Key input Data input Expected output
1 2b7e151628aed2a6abf7158809cf4f3c 3925841d02dc09fbdc118597196a0b32 3243f6a8885a308d313198a2e0370734
2 2b7e151628aed2a6abf7158809cf4f3c762e7160f38b4da5 f9fb29aefc384a250340d833b87ebc00 3243f6a8885a308d313198a2e0370734
3 2b7e151628aed2a6abf7158809cf4f3c762e7160f38b4da56a784d9045190cfe 1a6e6c2c662e7da6501ffb62bc9e93f3 3243f6a8885a308d313198a2e0370734

Note

  • The data passed will be a single block.
  • There will be 3 different sizes of keys passed.
    • 128
    • 192
    • 256
  • The cipher mode will always be ECB
  • It is allowed to use packages or build-in functionality for this, which means writing your own cipher code is optional.

Test Results before solving the challenge

codecheck: Finish with code 9
codecheck: tests  : 9
codecheck: success: 0
codecheck: failure: 9

Test Results after solving the challenge

codecheck: Finish with code 0
codecheck: tests  : 9
codecheck: success: 9
codecheck: failure: 0

Run Tests

To run tests locally install codecheck by running the following command in terminal

$ npm install codecheck -g

To run tests in web editor please click in RUN button on left side of web editor

Explain your code

In answer.md write a brief explanation

  • About how your code works
  • Problems faced while solving the challenge
  • How you solved those problems
  • Improvements/Feedbacks are also welcomed

References

codecheck-1904's People

Watchers

 avatar

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.