This tag is used for code review questions relating to cryptographic topics such as encryption/decryption and hashing.

learn more… | top users | synonyms

0
votes
1answer
23 views

More efficient columnar transposition decryption

Below, I have created a rudimentary script to decipher a columnar transposition. I am wondering if there is a more efficient way to determine the number of the rows in a column? Also, is there a way ...
5
votes
1answer
60 views

Hash-based cipher

I've written a cipher class based off of cryptographically secure hash functions and block cipher counter mode of operation. It currently runs around 20MB/s on my machine with the Java implementation ...
4
votes
1answer
14 views

Salsa20 stream cipher

I have been implementing Salsa20 by studying the design and specification. I have made sure to unit test every function along the way and match the outputs against the test vectors in the spec. I am ...
6
votes
1answer
129 views

Bitcoin algorithm BIP0039: Mnemonic code for generating deterministic keys

This is an implementation of BIP0039 in Rust (I used python-mnemonic as a guide). I'd like my first Rust program to be critiqued. I would like to know if the program is structured correctly, if I've ...
3
votes
1answer
64 views

Truncate 160-bit output from SHA-1 to 64-bit uint64_t

I'd like to truncate 160-bit output from SHA-1 to receive a (weaker) 64-bit digest. It has been a while since I did the type of low-level C pointer arithmetic in the but-last line. Could you please ...
7
votes
1answer
49 views

sha1sum implementation in C++

I rarely program C++ in anger, and considered myself somewhat rusty, and certainly not up to speed on C++11. For a bit of exercise, I thought I'd try implementing sha1sum, as wasn't really up to speed ...
6
votes
2answers
268 views

C# AES Encryption

I've been researching AES encryption a bit over the past several days. The official (MSDN) examples I've seen are encrypting and decrypting using the same AES instance. They don't go in to what to do ...
2
votes
1answer
32 views

Encrypting messages using the XOR operation

recently I've started to learn Clojure. I came up with an easy programming problem, described by this C code: ...
8
votes
2answers
69 views

Encoding and decoding small strings of text

This is supposed to encode and decode small strings of text. Unfortunately, even on a really good laptop, it performs slowly. This might have to do with my looping, or just the sheer computation. It ...
5
votes
1answer
68 views

Simple encryption based on MD5

I made a Python 3(.4.2) program that only adds classes and is meant to be imported. It allows the creation of files that store usernames and hashed passwords. It uses salting as well. It also can ...
8
votes
1answer
99 views

C# SHA512 Memory Issue

I need an implementation of PBKDF2 in C#. There is already a class Rfc2898DeriveBytes, but it uses SHA1, and I need SHA512. The problem that I faced with during ...
9
votes
3answers
597 views

Brute force MD5 password checker

I'm trying to create a C# brute force MD5 password checker. If I run it with "test1" without MD5, it completes in 15 seconds. I would like to make it faster, but I'm a c# beginner, and don't know how ...
4
votes
2answers
483 views

Simple password encryption / decryption in C++

The below code is for a simple password encryption/decryption program. The code is working perfectly, but the only thing I want to know from you is if this is good logic. PEND.h ...
10
votes
4answers
883 views

FileScrambler, a command-line file encryption tool

I decided to try my hand at making an encryption utility, which I lovingly call "FileScrambler". FileScrambler allows the user to encrypt a file (a master-password list, personal diary, or whatever) ...
2
votes
0answers
84 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 ...
1
vote
0answers
72 views

AES encryption class

I am new to encryption and recently wanted to learn more about it. I researched how to do AES Encryption in java and assembled my own Java AES encryption class. I don't know if there are any major ...
0
votes
0answers
25 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 ...
3
votes
1answer
139 views

PHP secure random number generator

I just wrote this function and I was curious if anyone could find any flaws in it? It look pretty secure to me but I just want to make sure since I'm no cryptography expert. ...
1
vote
0answers
70 views

Is this implementation of the ECIES cipher correct?

I downloaded source code of cryptosms and implemented the ECIES cipher in my work for Java mobile. I doubt validity of this step (full code of my method is below): ...
3
votes
1answer
98 views

Transparent encryption of HTML5 storage engine(s)

I am looking for feedback and possible suggestions regarding a piece of JS code that performs transparent symmetric encryption/decryption of user specified data using the HTML5 ...
4
votes
1answer
239 views

Encrypting data on client side and passing it to server side

I'm passing the data to PHP server side which will use the information later as this: ...
7
votes
3answers
2k views

Simple password encryption / decryption

I'm working on a simple data storing program for my senior year (Secondary School / Grade 12), and there is a user sign-in functionality I've decided to implement. The way I've done this is by storing ...
4
votes
1answer
110 views

Polyalphabetic cipher

I am trying to write the simplest to undestand code possible, each function has documentation and examples and I tried to use the best style possible. ...
2
votes
1answer
39 views

Optimizing mcrypt encryption class further

The following is a very simple implementation of an Encryption class using mcrypt whereby the functions encrypt and ...
5
votes
2answers
100 views

Secure password hashing implementation

I'm implementing a password hashing method for a website. The code below is part of the User class. Any pointers on what I could do better? ...
3
votes
2answers
630 views

Encryption with many algorithms using Crypto++

For the last few days I have been working on this code to develop a class that allow me to crypt a block of byte with many algorithme. One block will be divided into three equal blocks and every ...
3
votes
1answer
189 views

Encryption/decryption of a string with a salt

I have a new job coming up soon and want to increase my PHP knowledge. This is my first attempt at creating and using a class. I just want to know if it's the correct way to do things. It's very ...
2
votes
1answer
326 views

BouncyCastle RSA Implementation

This is my implementation of 1024bit(can be changed) RSA. Is there anything I'm doing wrong? ...
6
votes
2answers
318 views

MD5 shuffling with a defined pattern of numbers

I've created a MD5 shuffler with a defined number pattern. Does this make sense? Will this make storing passwords more secure? Is it efficient? ...
4
votes
1answer
54 views

String encryption function in admin section

I have been using this function locally to encrypt strings for example a username. If the user successfully logged in, place the encrypted username into a ...
4
votes
1answer
653 views

BouncyCastle Rijndael 256 Implementation

I modified the implementation from this website to include a salt: ...
0
votes
1answer
338 views

Decrease file size of encrypted file

I am making a Cryptography application and I noticed that the encrypted file is approximately 2 times bigger because I am encoding the files in base64. Are there any file encodings that take less ...
2
votes
2answers
127 views

Change random methods without losing too much performance

I have a class in C# that uses a Random object to get a list of numbers randomized from an array of 1-25. Now what I need is improve this method to use ...
1
vote
0answers
215 views

Encrypt texts, with saved password using pycrypto

I have the code bellow, which is supposed to be used inside a larger program. Please see notes about the requirements below the code. ...
0
votes
1answer
703 views

256 bit AES encryption in Android

I am using the following code to encrypt a file in an SD card in Android: I want the code to be reviewed for: Security (prioritize this) Coding Style Performance ...
12
votes
1answer
195 views

Cryptographically-secure super-secret government message transaction machine

-Hello Agent. Are you on a secure line? -Yes, secured. -Good, in 30 seconds the launch codes will be in your e-mail's inbox. You now have the go. Are you ready for the package? ...
5
votes
2answers
127 views

How easy is it to crack this encryption algorithm?

When I was about 13 or 14 years old, I was a little interested in cryptography (which is, after all, an interesting field). I learnt quite a lot since that time (it has been about 8 years since then), ...
5
votes
1answer
66 views

Clarity of encryption class

I have recently gotten back into development and I am wondering if the script I have just created is clearly documented and easily understandable throughout each step. Is it easy to understand? ...
10
votes
2answers
85 views

Citadel's VisualEncrypt and VisualDecrypt

I was skimming through this paper out of boredom. On pages 5 and 6, the paper shows a simple encryption/decryption scheme that Citadel uses to obfuscate data. The algorithm basically XORs the next ...
6
votes
1answer
265 views

Secure password-hashing in Java

Here is an article on password hashing, along with an implementation. Is this code secure with number of iterations 10000, key length 256 and salt bytes 32? Is there a rule-of-thumb for key ...
4
votes
1answer
177 views

Simple password dictionary attack script

This is my simple Perl script implement password dictionary attacking, encryption algorithm SHA1 with different length. It takes 2 arguments as input: first argument is password dictionary file path, ...
4
votes
0answers
142 views

Password-hashing method in Java [closed]

There is an article on Crackstation where they show you how to hash a password correctly. I've implemented the Java version of it which is working fine, but is the method they use secure? ...
5
votes
1answer
123 views

Parallelizing scrypt key-derivation function

To review my use of multiprocessing, I don't think it is at all necessary to understand the algorithm, but it's the scrypt key-derivation function. This uses ...
2
votes
1answer
253 views

User name and password validation in a MVP application

In a WinForms application I'm doing the password validation as follows: When the user presses the OK button after entering username and password, an event will be fired and the listener in the ...
2
votes
1answer
94 views

Ensuring client IDs are unique

I'm writing a node.js application that involves handling clients based on their ID without any real way of confirming that the ID a client says it has is its actual ID. That is, it's possible for a ...
6
votes
3answers
2k views

Simple Caesar shifter in C#

I use these in a windows form with fun buttons, I wanted to see what the world thinks of my coding. This is something that I coded about 2-3 years ago, I did change some of the coding when I looked ...
3
votes
3answers
64 views

Keyfile Generator

This is a Java program that generates a random keyfile (for OTP, for example). ...
3
votes
1answer
122 views

Structure and style of Enigma Machine

I took a little time and wrote the following code to produce enigma encryption. I don't normally write code in C so I would like to get feedback on the way it has been structured and any issues a ...
6
votes
1answer
96 views

MCRYPT - are there any flaws or areas for improvement in this class?

I am working on a class for encryption to use on my site. I have read through many examples of these functions and would just like to clarify a few points I have read and check if this code is worthy. ...
7
votes
3answers
79 views

Encrypt and backup folder to email daily, when online

I have a backup script which should backup a folder and send it to email. This should be done once a day. As this is on my laptop which is not online 24/7 I need to check that I am online and can send ...