Questions tagged [cryptography]
Questions relating to cryptographic topics such as encryption/decryption and hashing. (Not for use with trivial ciphers.)
465
questions
6
votes
3
answers
122
views
Idiomatic and performant file hashing
I've written a small program that will accept a directory path and recursively calculate the MD5 hash of each file.
...
2
votes
1
answer
86
views
Password recognition with cryptography
Since I only just learnt about this, I wanted some advice on better practices I can use when it comes to cryptography. Still learning python and hoping I can get this 'hashing' and 'salting' thing in ...
-3
votes
1
answer
88
views
Simplistic C program to encrypt and decrypt a string [closed]
I wanted to improve a crypter from internet. I found it poor and modified it.
Do you like it?
...
2
votes
1
answer
82
views
Generate a valid private key from public key
Given a public key, I want to generate a corresponding private key. I know this will take at least decades or centuries on average to achieve.
I am wanting to increase performance as my current code ...
2
votes
0
answers
84
views
0
votes
0
answers
770
views
Encrypt and decrypt text using 256-bit AES-GCM
I'm working on building an encrypt/decrypt feature using AES, and a fixed AES 256-bit key size. I have decided on using AES-GCM, as it seems the most performant and secure.
I would like to know ...
5
votes
2
answers
1k
views
SHA-256 Hash with a short string length in javascript
I think I've found a way to somewhat "compress" the length of a SHA-256 hash. I am doing some addition, so I wanted to know whether an approach like this is secure or not.
...
5
votes
1
answer
133
views
Hybrid encryption library for text/image encryption (additional feature implementation)
I am coding a hybrid encryption library that utilises AES and RSA to encrypt text/images, The library is working fine however I am wondering if I can make any improvements to it. I have included ...
2
votes
1
answer
137
views
An evolutionary algorithm written in Java to crack an XOR cipher
Alright. So TryHackme is a website that tries to teach hacking with hands on labs. They have a room called JVM Reverse Engineering where the user gets to reverse engineer Java apps, and in particular ...
8
votes
1
answer
312
views
Improving the speed of an MD5 implementation from scratch in C++
I wrote an implementation of the MD5 hashing algorithm from scratch in C++, following the original RFC: https://www.ietf.org/rfc/rfc1321.txt . It works as expected, and the outputs match all the test ...
3
votes
0
answers
109
views
Securely generate Token for authentication
In my experience i had the need that some application (both desktop and web) can excange data to authenticate users (even if the data for authenticating users are not reacheable form desktop ...
1
vote
1
answer
48
views
3
votes
1
answer
175
views
My Encryption Decryption Algorithm
I have been trying for so long to code an encryption/decryption algorithm using the modulus operator. Basically my code does a basic mathematical operation on given text and key then do a modulus 255 ...
1
vote
0
answers
7k
views
Simple AES encrypt/decrypt methods for .NET 6 and .NET Framework
I wrote some AES encryption/decryption methods with the following requirements:
Inputs should be easy-to-use strings.
Something encrypted in a .NET 6
app using these methods should be able to be ...
0
votes
2
answers
2k
views
AES GCM C++ implementation
I have written a C++ program that uses the Crypto++ library to encrypt files using AES-256Bit (in GCM mode). I am planning to eventually have the program store the keys for the files in a file e.g. ...
3
votes
2
answers
552
views
Encryption algorithm for chat app
I'm working on a CLI chat app using Python and I've coded this encryption algorithm.
I used hybrid encryption.
This uses an AES key as the shared key for encryption and decryption and RSA to encrypt ...
2
votes
0
answers
223
views
Simple Merkle Tree
Discussion
I just started learning about Merkle Trees and wanted to get some practice by attempting to implement a very simple Merkle Tree.
The constructor for the tree takes some type of hash ...
0
votes
2
answers
216
views
Encryption and Decryption in C
I have written a program in C, which encrypts and decrypts a c-styled string (const char *) and print the result to stdout. It ...
4
votes
1
answer
707
views
Rijndael Cipher in C++ (128bit AES)
I am a hobbyist and do not work in the industry, but I do have an interest in programming an cryptography. I decided to have a go at writing a 128bit implementation of AES in C++. This is my first ...
3
votes
0
answers
78
views
Arduino portenta H7 compatible message encryption and decryption
I am looking to build a message encryption/decription method that would allow messages to be encrypted in a timely fashion on board an Arduino Portenta H7, using as much of the onboard hardware ...
2
votes
0
answers
65
views
Simple CLI File Encryption
This program is designed to work on the command line by piping stdin to stdout and encrypting or decrypting the input using a symmetric key.
Any suggestions for improvement would be greatly ...
4
votes
0
answers
99
views
RC4 stream cipher in ARM Assembly
Below is a complete implementation of RC4 in ARM assembly. Unit tests pass, including comparison to C implementation and to published test vectors.
I'm appreciative of all feedback, comments (things ...
0
votes
1
answer
342
views
1
vote
1
answer
1k
views
.Net BouncyCastle - PKCS#3, PKCS#8 & PKCS#10 Generation as base64
Reaserching BouncyCastle for C# is not for the faint of heart. After navigating an ocean of Java dead ends, I have arrived at the following code.
I believe it's very useful for someone who wants to ...
4
votes
5
answers
5k
views
C++ AES Encryption Class
I am working with OpenSSL and writing an AES256 encryption module. My knowledge of cybersecurity is not vast and I would like to know whether there are any obvious holes I'm leaving. The intent is for ...
2
votes
1
answer
2k
views
Python 3 Playfair cipher encrypter and decrypter
I have written a Python 3 program that can encrypt and decrypt Playfair cipher, though I know it has been implemented countless times, none of the scripts I have seen so far(e.g. https://codegolf....
4
votes
1
answer
142
views
Enigma Implementation by Python newbie
I want to learn Python, so I ported a C# Enigma implementation of mine. It got UnitTests and is running.
I'm looking for a review, telling me, where I don't know best practices, where I break naming ...
4
votes
2
answers
172
views
Enigma Implementation by JAVA newbie
I want to learn Java, so I ported a C# Enigma implementation of mine. It got UnitTests and is running.
I'm looking for a review, telling me, where I don't know best practices, where I break naming ...
4
votes
1
answer
220
views
Cryptographic hashing class using OpenSSL's EVP interface
I have written a cryptographic hashing class named Ccksum::DigestHasher that allows the caller to select a hashing algorithm by name via OpenSSL's EVP interface. ...
0
votes
1
answer
248
views
Encryption/Decryption algorithm #3
This is a follow up question to Encryption/Decryption algorithm #2 and Encryption/Decryption algorithm.
In my last question, in @Reinderien's answer, he added this line ...
2
votes
1
answer
142
views
Encryption/Decryption algorithm #2
This is a follow-up question to this one.
I have tried to implement all the recommended things in the answers (except commenting, and not being OS specific). Again, if you see anything that needs ...
3
votes
3
answers
135
views
Creating a class and calling it from other .py files
My objective with this code was to create a class and call it from other .py files. The code itself is working, but I would like to know what could be improved or be better implemented.
I wrote ...
5
votes
1
answer
3k
views
Login system using bcrypt and MySQL, to be used for any future projects
Main function will ask what the user wants to do. LoginSystem class will handle the sign up and login process as well with the checking if password is right. passwordHashing will use bcrpyt to salt ...
1
vote
1
answer
2k
views
Encrypted text - C# SHA256, implementation
I have a C# application which needs to encrypt string and save the key as a hash. The key is saved as a hash to check the right key has been input before trying to decrypt the message.
First, I have ...
5
votes
3
answers
952
views
Caesar Cipher Encryption / Decryption in Python
I'm trying to write a Python program to predict the most likely substitution for a Caesar cipher. I managed to get it working, but it just seems very clunky and slow, especially because I need to ...
2
votes
2
answers
151
views
Encrypting/decrypting messages in java
I am trying to implement message encryption/decryption with password in java. Here is the code I'm using:
...
3
votes
2
answers
132
views
Correct implementation of encryption function
I wrote a simple encryption function that uses argon2d as the KDF and XChaCha20-Poly1305 as the AEAD. Since it is very easy to not get things right when dealing with encryption, I would appreciate if ...
6
votes
2
answers
2k
views
AES implementation in python
For educational purposes, I have implemented the AES block cipher in python. I decided to follow the interface for block cipher modules as defined in PEP 272. The implementation consists of two python ...
3
votes
2
answers
890
views
Encryption/Decryption between Python and Node JS
I have created a Python & Node JS encryption/decryption AES 256-CFB. The point of this little project is that I will encrypt a special URL with Python covered with base64 & URL encoding and ...
3
votes
0
answers
84
views
Implement kleptography in Python
I'm new here, therefore I hope to be clear in this question. Firstly, I want to underline that I'm not a programmer, and I attended only a beginner course in Python, but I like to solve problems ...
3
votes
1
answer
479
views
Very simple encryption API
I need an encryption system with a super simple API. I'd prefer something as simple as the following. The output should also be browser-friendly and ideally url-friendly.
...
3
votes
2
answers
794
views
Encrypts a message using the ADFGVX cipher
This is a Java program I implemented to encrypt a string using the ADVGVX cipher. It takes in the message, the passphrase used to generate the Polybius square, and keyword for the transposition part ...
3
votes
0
answers
308
views
C++ Crypto: Part 4- Scram
Looking around for modern Crypto libraries.
Could not find anything good.
I know I probably did this all wrong so work with me here. There will be four different reviews for four structures that build ...
3
votes
1
answer
461
views
C++ Crypto:Part 3-pbkdf2
Looking around for modern Crypto libraries.
Could not find anything good.
I know I probably did this all wrong so work with me here. There will be four different reviews for four structures that build ...
4
votes
1
answer
346
views
C++ Crypto: Part 2- HMAC
Looking around for modern Crypto libraries.
Could not find anything good.
I know I probably did this all wrong so work with me here. There will be four different reviews for four structures that build ...
4
votes
2
answers
308
views
C++ Crypto: Part 1- Hash
Looking around for modern Crypto libraries.
Could not find anything good.
I know I probably did this all wrong so work with me here. There will be four different reviews for four structures that build ...
10
votes
3
answers
491
views
Faster and cleaner SHA-1 leading zero histogram with Python
I've written a python code for finding the distribution of the leading zeros of SHA-1. Using random inputs and hashing-then-counting. Normally it is expected to fit the ...
3
votes
2
answers
104
views
Simple Password Generator Feedback
This is my first major project in F#, looking for any critique on how I can make it more standard or more concise.
Some things I feel like I could have done better are the command flag parsing and the ...
8
votes
1
answer
4k
views
XOR Encryption, Decryption, and Cracking in Python
I have recently been working through a number of the Cryptopals Cryptography Challenges to try and improve my knowledge and understanding of both cryptography and Python. As five of the first six ...
1
vote
1
answer
460
views
Caesar Cipher, done in Ruby
It's an assignment from the Odin Project.
Here's my implementation:
...