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
3
votes
1answer
145 views

File Encryption using pynacl

I need a rather simple file encryptor/decryptor in Python, after some research, I decided to use tye pynacl library reading the file in blocks, writing them back out, and then at the end using Blake2b ...
3
votes
1answer
53 views

Symmetric decryption with javax.crypto

I'm trying to determine if this code could be a memory hog with huge files. Can anyone tell me if there is anything I can do to make this more memory efficient, or is this how java.crypto works? <...
3
votes
1answer
1k views

Implementation of Ceaser's Cipher in Python

This is my implementation of a Ceaser's Cipher in Python using OOP principles. I'm looking for feedback for any code starting from the function build_shift_dict (...
3
votes
1answer
118 views

PHP password encryption algorithm

I've written a password encryption algorithm in PHP, which (I think) is not very vulnerable to rainbowtable attacks. It's just that I don't have a lot of experience with encryptions, nor PHP. But from ...
3
votes
1answer
336 views

Vulnerability of Encryption class using AES + HMAC

I've written an encryption-decryption class that is to be used in my companies commercial web application that will handle sensitive information. The encrypted data will be passed over the internet ...
3
votes
1answer
423 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 ...
3
votes
1answer
134 views

Code Review of Haskell PBKDF2

Moved from Programmers.SE. I have written a new version of the PBKDF2 algorithm in Haskell. It passes all of the HMAC-SHA-1 test vectors listed in RFC 6070, but it is not very efficient. How can I ...
3
votes
1answer
111 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 ...
3
votes
1answer
62 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 ...
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 ...
3
votes
2answers
120 views

JSafebox - Encrypted vault - 2nd drill

I am developing JSafebox, a portable safebox project written in Java. A first review have been completed here. The goal is to provide a secured environment where the user can browse encrypted files ...
3
votes
1answer
308 views

Script to encrypt a file and add it to IPFS(ipfs.io)

Here is the script that I would like reviewed for the following: Best practices and design pattern usage Correctness in unanticipated cases The script is made to store (IPFS) Interplanetary File ...
3
votes
1answer
1k views

ISO mode encryption/decryption with BouncyCastle

I need to implement an ISO-mode encryption/decryption library in C# using BouncyCastle. In this mode, users only need to exchange their RSA public keys to securely communicate. Operation is as follows:...
3
votes
1answer
1k views

RC4 implementation

I am using the following implementation of the RC4 encryption algorithm in C# ...
3
votes
2answers
623 views

AES class security

I am using the AES class (which I think I got from another post on Stack Overflow) for encrypting strings to a database. How robust and secure (would it be easy to break) is this class? Is there any ...
3
votes
2answers
261 views

Intel® TinyCrypt: AES-128/CTR to encryption/decryption of 2D arrays

I need to encrypt/decrypt 2D arrays (double pointers) using AES-128/CTR using Intel TinyCrypt (written in C). The following are two helper methods to simplify the library usage. Any comments would be ...
3
votes
2answers
158 views

Program to retrieve key/message from a multiple times used one time pad

I wrote a program to retrieve the key/messages from 10 different ciphers which were all encrypted with the same key with an xor one-time-pad method via crib dragging. To do this, I wrote a python ...
3
votes
2answers
3k views

Encrypt string using One Time Pad

I'm trying to make it so that a string generates n keys, and all of those are required to recover the original string. For this, I generate n-1 random strings, XOR them all together with the original ...
3
votes
1answer
519 views

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. ...
3
votes
1answer
370 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 ...
3
votes
1answer
160 views

Need Loops for PHP Username/Pass Encryption Script

I've created this PHP script to print a batch of usernames with encrypted passwords locally on my computer because the user/pass format is always the same. username = username password = username + &...
3
votes
1answer
895 views

File I/O, SHA1 sum and compression

The function hash_blog is inspired by "how git stores its objects". It is supposed to take a String, append a header to it, ...
3
votes
2answers
399 views

Nice design of my hash service class

I would like to know, if my design of this class is good OOP. Should I implement for every hash algorithm a separate class? I'm asking this, because the HashService ...
3
votes
1answer
219 views

WMSAuth implementation

I have to implement WMSAuth in C#: http://wmsauth.org/examples ...
3
votes
1answer
54 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
175 views

My images have secrets A.K.A. the making of aesthetic passwords V.2

This is my implementation of a prng steganography tool written in Python. You can also find the code on GitHub. Steganography is the art of hiding messages in (images, videos or even audio) I've ...
3
votes
1answer
337 views

Cryptopals Challenge 1.6 Solution in Golang

This is my solution to challenge 1.6 from Matasano/NCC Cryptopals. Here is my repository so the code can be cloned/ran and the bitutils/futils code can also be looked at if necessary (I've created ...
3
votes
1answer
241 views

Encryption functions intended for production

I want to know if these encryption functions are ok for a live production application. Based on resources here and here and here I have put together these three functions. Purpose This code is for a ...
3
votes
1answer
100 views

Sorting dictionary according to letter patterns

I've written a JavaScript dictionary sorting algorithm, which takes a .txt file (the dictionary), and loads it via node's file system. The purpose of this algorithm is to sort every word into its ...
3
votes
1answer
644 views

Recreating binary counter for arbitrary length arrays

After weeks of slaving over FIPS-197, I finally have my own working C/C# implementation of AES-128 which I'm quite happy about. The next thing I'm looking to do is implement a ...
3
votes
1answer
12k 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 ...
3
votes
2answers
231 views

TreeShell PRNG and Encryption Algorithm Review

I've always wanted to come up with my own algorithm for encryption. Last evening I started writing "TreeShell" encryption algorithm that uses bit shifting and XOR operations on the bit level to do ...
3
votes
0answers
51 views

Atbash cipher in Ruby

I implemented my own spin on the Atbash cipher in Ruby: ...
3
votes
0answers
308 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 ...
3
votes
0answers
261 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, ...
3
votes
0answers
336 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 ...
3
votes
0answers
1k 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. <...
3
votes
0answers
2k 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 ...
3
votes
0answers
280 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 ...
3
votes
2answers
209 views

File-encryption utility application

I made a simple file-encryption utility application for a little school project. I'm really interested in cryptography, and tried my best while making it. Can you see it, and give me feedback? The ...
2
votes
3answers
177 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
3answers
116 views

App to Encrypt and Decrypt file

...
2
votes
2answers
215 views

Is my cipher secure?

This is a program that I made for encrypting text files, it uses a one time pad cipher to encrypt the files, but I do not know if there are any holes in my program that could be a vulnerability. <...
2
votes
3answers
4k views

Implement Transposition cipher in c++

I try to implement the encryption by Columnar transposition. Input: key_secret and Text_to_encrypt, both of them are in lower. Output: encrypted_text. The code works fine but I have some questions: ...
2
votes
2answers
79 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 ...
2
votes
2answers
3k views

C# AES256 CBC Implementation

I was looking for a proper implementation of the AES256 encryption in C# but didn't find anything I was entirely satisfied with, so I decided to take this opportunity to write a class myself and maybe ...
2
votes
2answers
959 views

Linear Feedback Shift Register

I haven't found any implementation in C# of the LFSR so accordling to Wikipedia i have implment it to myself. https://en.wikipedia.org/wiki/Linear-feedback_shift_register My implementation accept ...
2
votes
2answers
4k views

Modular exponentiation optimisation in Java

As part of an assignment in Cryptography I've been asked to write code that involves calculating modular exponentiation. The BigInteger modPow is not allowed in this case, we have to implement it ...
2
votes
2answers
75 views

Checking hash and passwords with a wordlist, more efficient

I have done a small code in which with a wordlist (out68.lst) I get the passwords from the hashes in the file 'shadow3'. ...
2
votes
2answers
75 views

C# Security Module for generating secure hashes

Any pointers on the level of security this hashing function perform at? I have never had to really write my own modules for security before. ...

1
5
6
7 8 9