Skip to main content
Share Your Experience: Take the 2024 Developer Survey

Questions tagged [cryptography]

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

36 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
6 votes
0 answers
481 views

Bash script for pull-mode backups via restic's rest-server

I wrote the following Bash scripts to make pull-mode backups with restic, a backup solution written in Golang, similar to Borg Backup. The main use case for this script is pulling backups into a ...
andrew-e's user avatar
  • 353
4 votes
0 answers
127 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 ...
Skary's user avatar
  • 248
4 votes
0 answers
128 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 ...
SRobertJames's user avatar
4 votes
0 answers
148 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 ...
1f604's user avatar
  • 41
4 votes
0 answers
165 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 ...
user668074's user avatar
4 votes
0 answers
2k views

Encode object to JSON and encrypt with AES (with tests)

While the task at hand is relatively straightforward, it turned out AES in Go is a bit clunky so I was wondering if this seems right. Also, any tips on Go coding in general are more than welcome. <...
fstanis's user avatar
  • 380
3 votes
0 answers
336 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 ...
Jae Bradley's user avatar
  • 1,845
3 votes
0 answers
101 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 ...
L Selter's user avatar
  • 131
3 votes
0 answers
86 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 ...
Davide Motta's user avatar
3 votes
0 answers
381 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 ...
Martin York's user avatar
  • 95.2k
3 votes
0 answers
77 views

Atbash cipher in Ruby

I implemented my own spin on the Atbash cipher in Ruby: ...
Noctilucente's user avatar
3 votes
0 answers
691 views

Verify OpenSSL RSA signature (PHP) with .NET (VB)

I would like to achieve something I believe is pretty standard: A) My VB.NET client (ideally targetting Framework 4.0) sends a text string to my Apache/PHP Server via an HTTPS POST request. B) My ...
Ama's user avatar
  • 265
3 votes
0 answers
357 views

ECDH implementation in python (part 3)

After the first and second part, the primary feedback I got was to rename a lot of my variables as I used the same name for different local variables which is really confusing. I tried to hotfix that, ...
Aemyl's user avatar
  • 690
3 votes
0 answers
366 views

Python2.7 Some xor fun

After doing the Cryptopals challanges, which I found scrolling through codereview, and finally being able to solve set1 challenge 6. I decided to have a little xor fun, and make an automated xor ...
Ludisposed's user avatar
  • 11.5k
3 votes
0 answers
1k views

Hashing a SecureString in C#

In .NET, the SecureString type exists to prevent leaking secrets in memory. I want to create a hash from the contents of a SecureString, without putting the contents in memory in a place where I can't ...
Sjoerd's user avatar
  • 319
3 votes
0 answers
3k views

Web API 2 - JWT with X509 certificate

I got my JWT generation working with X509 and wanted to ask if you would recommend any changes in respect to: Signing certificate storing / handling. Publishing for anonymous access public key ...
erPe's user avatar
  • 131
3 votes
0 answers
298 views

Streamed encrypt then MAC construction

I've been porting python Keyczar to work under 2to3 conversion (Github). I wanted to consolidate its streaming AES encrypt/decrypt backend interface with its string decrypt/encrypt. So I wrote a new ...
jbtule's user avatar
  • 341
2 votes
0 answers
165 views

Point addition on secp256k1. Exploring other alternatives for practical purposes

...
Knm's user avatar
  • 21
2 votes
0 answers
68 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 ...
muckypops's user avatar
2 votes
0 answers
37 views

Javascript client storage with the same persistence as a session cookie

I want to implement a client storage mechanism that is as persistent as a session cookie but with more storage capacity. I am doing this by encrypting the data before storing it and saving the keys in ...
Gamer2015's user avatar
  • 121
2 votes
0 answers
90 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 ...
Franartur Čech's user avatar
2 votes
0 answers
656 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 ...
scripts's user avatar
  • 121
2 votes
0 answers
44 views

RC4 in Sinclair BASIC; Working around one-indexed arrays

This is a program written in Sinclair BASIC (48 BASIC) for the Sinclair ZX Spectrum. It uses a hardcoded key (null right now) as seen in the bottom and outputs a stream of integers generated with RC4. ...
speccylover's user avatar
2 votes
0 answers
737 views

Python RSA/DSA File Cryptography, Key Generation, Key Protection

I have forked a previous version of my script, critiqued here: Generate public/private keys, encrypt, decrypt, sign, verify This program allows you to encrypt and decrypt raw files using RSA keys ...
FodderOverflow's user avatar
2 votes
0 answers
821 views

Wrapper/abstraction for encryption and decryption using OpenSSL

I am a beginner when it comes to cryptography and OpenSSL. I have written a short wrapper of some functions in OpenSSL as well as a test of this wrapper, copied below. Specifically, this code is ...
waynemystir's user avatar
2 votes
0 answers
218 views

Locally encrypt/decrypt credentials

I wrote some code to encrypt and decrypt some user credentials for services that a locally run application needs to work. I get a password from the user, use it to stretch a key via Scrypt, and then ...
berdario's user avatar
  • 161
2 votes
0 answers
1k views

Converting [UInt32] -> [UInt8] -> [[UInt8]]

I am trying to speed up my current implementation of a function that converts [UInt32] to a [UInt8] which in turn is split up ...
p0ppy's user avatar
  • 21
2 votes
0 answers
2k views

LockBox TwoFish string encryption and decryption

I'm using TurboPower LockBox for the first time, and using the TwoFish algorithm to first encrypt a password, and later retrieve the password by decrypting the generated hash. I would like to know ...
Steve F's user avatar
  • 121
2 votes
0 answers
404 views

T-SQL Totp (Rfc6238 SHA2_256) Implementation

Using my previous function as a base I've come up the following: ...
Kittoes0124's user avatar
  • 1,940
2 votes
0 answers
423 views

Simple encryption with PHP 5.5

I want to do simple encryption using PHP 5.5. By “simple” I mean I want to use native PHP functions. I have created this code that works, can it be improved? It's to encrypt/decrypt strings and binary ...
texelate's user avatar
  • 121
2 votes
0 answers
208 views

AES256 + HMACSHA256 'secretbox'

I aim to create a few primitives for creating AES256-then-HMACSHA256 secured session state through cookies. What I've considered: HMAC instead of plain sha to avoid hash extension attacks input ...
Henrik's user avatar
  • 81
1 vote
0 answers
988 views

Python script to compress and encrypt a list of files/directories (tar + gpg)

I've tried, as practise, to write a Python 3 script which takes a list of paths to files/directories and compresses them with tar, before encrypting the resultant ...
Marika's user avatar
  • 11
1 vote
0 answers
129 views

SHA-256 implementation in JS (core codes)

As told by experts, I am re-posting the code review request with the code. Brief Description: from outside sha256() will be called with parameter having UTF-16 character set. then after prepareData()...
Sayan Shankhari's user avatar
1 vote
0 answers
14 views

Compressing and encrypting file systems for backups

I am currently backing up remote OS' while preserving the permissions using rsync: rsync -aAX --numeric-ids --delete ... [email protected]:/ /backup/server/ Now I ...
maxisme's user avatar
  • 237
1 vote
0 answers
1k views

KDF computation using CMAC with AES (as PRF) using Bouncy Castle C# library

Using bouncy castle .net implementation (version: 1.8.1.0), I am trying to create an encryption key from a known master key using a key derivation function. The NIST Publication 800-108 contains ...
Raghu's user avatar
  • 163
0 votes
0 answers
9k 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 ...
Rick Davin's user avatar
  • 6,350