Coder Social home page Coder Social logo

arthurf23 / cryptography Goto Github PK

View Code? Open in Web Editor NEW
4.0 1.0 1.0 53.38 MB

C++ AES-128 encryption header for text and files.

License: MIT License

C++ 100.00%
encryption encryption-decryption aes-encryption aes encrypt decrypt decryption encryption-algorithms simple open-source

cryptography's People

Contributors

arthurf23 avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

mathio3

cryptography's Issues

AES Code Rewrite

The code for the AES encryption and decryption is messy and also partially is not my own, therefor I want to rewrite it as my own to improve readability, performance, and add comments.

Encrypt and Decrypt problem regarding AES

Let me go over the steps involved and show you what the problem is.

I'm inputting the string "bruh bruh Bruh Bruh Bruh Bruh a Does this actually work finally like what the frick dude this has been so long" to encrypt() and that's broken down into 16 characters, then converted to hex, those are here:

62727568206272756820427275682042
72756820427275682042727568206120
446f657320746869732061637475616c
6c7920776f726b2066696e616c6c7920
6c696b65207768617420746865206672
69636b20647564652074686973206861
73206265656e20736f206c6f6e677e7e

Notice how those are the same length
These are the the encrypted values:

42a92b6455ade990e8cdd66efab782aa
36617cd36cf8f0f21925c070aa5fde
9d39ed97ebd819a8497dd8cde9f5
ba88f4c21a1ccee32b8a645852bef1b9
6c52e438fce48986ddc6d11d441773cd
77f1dfe85ebd8c8b905badaba0ecf9
f33c442c1f1967ef8f21e1c551f5f69

Notice how those aren't the same length.
When decrypt() is passed the complete string which is getting the string 42a92b6455ade990e8cdd66efab782aa36617cd36cf8f0f21925c070aa5fde9d39ed97ebd819a8497dd8cde9f5ba88f4c21a1ccee32b8a645852bef1b96c52e438fce48986ddc6d11d441773cd77f1dfe85ebd8c8b905badaba0ecf9f33c442c1f1967ef8f21e1c551f5f69 you may already see the problem, those blank spaces are not accounted for so then when decrypt() is getting the string, it doesn't know what those blank spaces are, so everything is getting shifted and then jumbled. I've been trying to put %'s (or whatever it is at the moment, check encryption.h static constexpr char fillerChar to see its value) in the blank spaces but that still makes the decrypt() freak out. If you know any potential solutions I'm all ears and any help will be credited.

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.