Questions tagged [cryptography]

Questions relating to cryptographic topics such as encryption/decryption and hashing. (Not for use with trivial ciphers.)

Filter by
Sorted by
Tagged with
0
votes
0answers
12 views

A register of government decrees, authenticated with blockchain and public key cryptography (2)

This is a follow-up question to this question, having carried out some of the advise kindly provided by other users. The full repo is here, but I'll post the most important extracts below. ...
2
votes
1answer
28 views

A register of government decrees, authenticated with blockchain and public key cryptography

The full repo is here, but I'll post the most important extracts below. Background I'm trying to get the hang of blockchain and public key cryptography, so I thought it would be fun to create a ...
4
votes
0answers
33 views

Automatically encrypting text editor

I have written an automatically encrypting text editor (github link). The reasons that I wrote this program instead of using vim + gpg are: It's more convenient than vim + gpg (user only needs to ...
9
votes
3answers
1k views

Secrets management, operational security, keeping API tokens hidden while streaming

I've taken up code streaming and I'm concerned that as I do so, I'll leak an API token somewhere. It was suggested that I use something like "a secrets.toml or secrets.yaml or secrets.json file." But ...
2
votes
3answers
111 views

App to Encrypt and Decrypt file

...
2
votes
3answers
136 views

XOR two files together

I am trying to XOR two files each 1Mb which contains only 0 and 1. It works, but I think it is very slow for the C++ program - approximately 4 sec. Could someone, please, suggest the fastest XOR ...
2
votes
1answer
49 views

Java Cryptography AES/GCM/NoPadding without IV

I'm implementing a PAKE-protocol as a university project and one step of the protocol involves sending encrypted data from a key created via a hash function (I'm using SHA-256). I want to use AES/GCM ...
2
votes
2answers
90 views

Encrypt data before sending it to server in a way that makes it unreadable to anyone except the user who sent it

I don't have any experience in cryptography and I've written some crypto code that seem to be working, but I'm not sure if it safe and if the tools and methods I used are right. Objective Make it ...
2
votes
1answer
36 views

Custom code for MD5 in js [closed]

I wanted to write my own code for md5 in javascript and learn its inner mechanics. (I know it is not trusted anymore, deprecated, ... but I'm just learning). I didn't want to just copy the code that ...
3
votes
1answer
52 views

Inversionless Lenstra ECM running way slower than it should

So I was coding Inversionless ECM using Prime Numbers: A computational perspective and when I finished and tried running my program it ran way, way slower than it is supposed to. I have no idea what I ...
3
votes
1answer
75 views

Crypto createCipheriv and createDecipheriv for authentication

I'm not an expert in authentication, so I want to make sure I have done everything right. I am using crypto.createCipheriv and ...
2
votes
2answers
81 views

Encrypting an AES key

This encryption class RSA encrypts an AES key and then when the encrypt method is called it decrypts the AES key and uses the key to encrypt the message and basically the same thing with the ...
2
votes
1answer
50 views

Validate implementation of ECIES

I've created a basic implementation of ECIES (Elliptic Curve Integrated Encryption Scheme) based on http://www.secg.org/sec1-v2.pdf section 5.1. ...
2
votes
1answer
68 views

Berlekamp–Massey Algorithm in Haskell

I was recently tasked to write an implementation of the Berlekamp–Massey algorithm (for GF2) from a given inductional proof and decided to fresh up on my Haskell, since converting a proof by induction ...
2
votes
0answers
71 views

Custom mini cipher

I'm a 14year old and still learning. I know everyone says "don't roll your own crypto", however I decided I must make my own cipher in javascript as soon as I have enough knowledge. I started simple ...
2
votes
1answer
108 views

Java RSA / AES-GCM encryption utility

I wrote a utility class that has simple methods for: En/decrypting data with 256-bit AES-GCM using a password Generating RSA keypair Saving RSA keypair and storing private key encrypted En/decrypting ...
7
votes
1answer
261 views

CypherVault - Command Line Password Manager

I have created a Python 3 password manager for API keys and social media passwords on local storage. The script is 500 lines and PEP8/PYLINT compliant, each definition contains a docstring and the ...
2
votes
1answer
55 views

SHA256 javascript implementation

I implemented a sha256 hash function for javascript just for a practice and I want to know if my code needs more improvement. Please tell me which to simplify if there's any. Thanks. Here is my code: ...
2
votes
2answers
75 views

A better cryptography process

I am experimenting with cryptography and I was wondering if somebody has some suggestion how I could improve my code and methodology. I want my process to generate more securely the cryptography ...
0
votes
1answer
70 views

Cryptopals first challenge - hexadecimal to base64

I've just started the cryptopals-challenge, and now wanted to show my solution to the first challenge here: ...
4
votes
2answers
80 views

Fleissner-Grille / Turning-Grille in Java

I've implemented the cryptographic method of the Fleissner-grille aka Turning-grille . Here's the code: ...
1
vote
2answers
60 views

Decrypt multiple 10Mb files with defined password

One operation of my Android project is to decrypt one file (chosen in a set of ~30 files for pagination1) of ~10 Mb each and I do this with the following: ...
0
votes
1answer
147 views

Password hashing (PBKDF2) and RSA encrypt + AES 256 in Java

Here's what I could comprehend in C code: Generates a key using PBKDF2 Generates an IV which is MD5 of PBKDF2 key in step #1 Does AES-256 encryption on customer-id - which is one of the output RSA ...
7
votes
1answer
158 views

Understanding RSA key generation and implementation in Java

Here is an attempt to leverage Java's BigInteger class to implement the RSA algorithm, as well as md5 and sha512 hashing functions to generate keys for what I hope to be strong cryptography. My prayer ...
7
votes
1answer
70 views

Incremental, encrypted backups for git

I would appreciate any review of the following script I recently posted on GitHub (gitcrypto). Most notably, I would be interested in a review of the cryptographic aspects (I am not an expert in this ...
3
votes
1answer
59 views

CliwPw - Yet Another Python3 Password Manager

I wrote a (very) simply Python3 password manager to familiarize myself with Sqlite3, and for fun. I am aware that there are already a variety of password managers out there, but I wanted something ...
13
votes
2answers
2k views

A randomized encryption program

I have just created an encryption program with a friend. I wanted to know if anyone here could give me back any feedback on it. Here is how the program works: Imagine you want to encrypt the word '...
0
votes
1answer
102 views

SHA256 hash bruteforcer

I made a SHA256 hash bruteforcer as my first program in Rust. It's very specific to what I'm trying to bruteforce and I'll probably never find it. I translated it from Python to make it faster, but ...
0
votes
1answer
116 views

Encrypt a file using Botan library

I need to build something that is not very complicated, but efficient. I don't have much time to debug. I don't know if this method is strong enough to encrypt a data to be displayed in a Qr code. ...
11
votes
2answers
3k views

A Caesar cipher in Python3

This code basically just does a Caesar cipher on the contents of the variable "s" with a shift of 1. Sorry if the comments on the code don't explain it well. I'm quite new to Python and I'm not very ...
13
votes
4answers
2k views

Fast symmetric key cryptography class

I am trying to build a fast cryptography algorithm. The algorithm works fine, but I am worried if there are any potential flaws that might make the algorithm vulnerable to any kind of attack. Here is ...
2
votes
0answers
93 views

XXTEA encryption implemented in modern C++

At the company i work we have a system where an user is presented with a question and some alternatives to choose from. The question and answers are generated at runtime. In order to simplify the ...
4
votes
1answer
103 views

Python Secure Implementation Of AES-256-CTR Using Cryptography.Hazmat

I've implemented a wrapper for AES 256 CTR mode using the cryptography.hazmat module, I am wondering if there are any vulnerabilities in my implementation, specifically about the counter and its ...
5
votes
1answer
141 views

Encrypting credit card data

I need an encryption algorithm that would be secure enough to store credit card data. So it should be reasonably secure. Here's what I've come up with. I'd appreciate any constructive criticism. <...
1
vote
1answer
39 views

Small service for hashing and validating passwords, using PBKDF2

As part of a larger authentication/authorization system, I've developed a small .NET Core 3.0 service for hashing passwords using PBKDF2 (with a salt) and validating passwords against a stored hash/...
-1
votes
3answers
46 views

Implement state eraser for NIST DRBG and other crypto primitives using macro

As a spare-time personal project, I'm implementing a set of symmetric-key cryptographic primitives. One thing I've left vacant for a long time, is the key/state eraser, which I decide to add right ...
4
votes
2answers
119 views

C# Cryptography Interface

C# lacks a common off-the-shelf encryption and decryption interface for dependency injection. Nearly every codebase I've ever opened has a couple of extension methods for hashing strings and so on. ...
5
votes
1answer
124 views

Educational implementation of SHA256 in Rust

A few weeks ago I decided to have a look at the Rust programming language. After a few standard exercises I chose to try to implement the SHA256 hashing algorithm, because why not. The algorithm's ...
4
votes
1answer
86 views

Data encryption / decryption on Node.js

I've implemented my first data encryption / decryption methods on Node.js. Although it might look similar to hundreds of sample implementations available online, I'm curious to get a feedback. I'm ...
3
votes
1answer
101 views

kryptein cryptography package for Node.js

I have written a cryptography NPM package called kruptein. The code is also hosted on GitHub. Having used multiple "best practices" with regards to key management, algorithm selection, key size, iv ...
6
votes
2answers
440 views

A simple implementation of the principle of RSA encryption

Inspired by a Numberphile video I made a little program that shows the principles of RSA encryption and decryption. To calculate the keys I used the explanation in this link: rsa public private key ...
3
votes
1answer
117 views

Capsulation solution for byte arrays

In a part of the project, I had to implement a solution for encapsulation of byte arrays. We do use ssh and secure ports for socket connection but I was in need of an extra layer of protection against ...
5
votes
2answers
124 views

PLINQ code analysis in terms of efficiency of cryptographic hashes generation

I have the following code that I wrote in order to find the correct password by generating hashes out of all possible combinations and comparing each of them with the target. I'm trying to make ...
1
vote
1answer
110 views

Expose encrypted serial ID in Elixir

I'm working on a Phoenix/Absinthe application and I thought to expose encrypted sequential IDs instead of UUIDs since these are a bit shorter. Encryption on Elixir/Erlang seems very hard, so I think I'...
3
votes
1answer
55 views

A Tumbler, or a format-preserving-encryption shuffle

I wanted to implement a simple algorithm for encoding id of entries in a database to avoid: Storing the UID (unique id) in the ...
2
votes
2answers
155 views

Light Security Local-Machine Password Encryption

I have a program that makes a call to an SQL database. I cannot use SSH to connect to it (as far as I am aware) or any other more secure method, so Java's SQL connector was used. As the connection ...
1
vote
0answers
42 views

Difference distribution table for DES

This is my DDT (for DES) code. I just wonder how to be more efficient... I've just started cryptography and I'm not good enough. ...
11
votes
2answers
1k views

Implementation of the Jacobi Symbol in C

I am new to C programming and wrote the following algorithm for the calculation of the Jacobi Symbol. Though there are some faster versions of this algorithm available I am only looking for some ...
4
votes
2answers
68 views

File encoder/decoder in Nim

I wrote a simple program to encode a local text file with password and decode it back. There is one text file and it is either encoded with a password or is in plain text. I had a version in Python ...
4
votes
0answers
78 views

SHA256 implemented in Rust

I just finished making an implementation of a SHA256 hashing function (https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.180-4.pdf) in Rust and I was looking for some feedback. As far as I can tell it ...

1
2 3 4 5
9