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
199 views

WMSAuth implementation

I have to implement WMSAuth in C#: http://wmsauth.org/examples ...
0
votes
0answers
225 views

Markov Encryption API in Python 2.5

The module in question provides classes used to execute Markov encryption and decryption on arrays of bytes. ME was inspired by a combination of Markov chains with the puzzle of Sudoku. This version ...
4
votes
1answer
2k views

Am I using crypt and mcrypt well in this simple encryption class?

These days I read a lot here on SO about password hashing and data encryption. It's a real mess, I mean, deciding what the best practice is. I need a very simple class that can be reused anywhere and ...
7
votes
2answers
2k views

Canonical Python symmetric cryptography example

Python Cryptography Example Last weekend I wrote some code to help people use PyCrypto in a canonical fashion to symmetrically encrypt and decrypt strings and files. By canonical I mean I've followed ...
11
votes
4answers
7k views

My own SHA-256 code implementation

I'm worried about my code performance. The code I've written is an implementation of SHA-256 using pseudocode from Wikipedia. It works fine, but I want to speed it up. With a buffer of 4096 bytes, I ...
1
vote
1answer
137 views

Nginx cache path function

I have an MD5 hash string: _hash = '743a0e0c5c657d3295d347a1f0a66109' I want to write function that splits passed string to path in nginx cache format: ...
3
votes
2answers
3k views

Rot -n algorithm in Java

This is a rot-n (rotate n times) encrypt/decrypt algorithm, where n can be any integer (+/-). It's written to encrypt/decrypt all the alphabets (upper/lower case) and leaving behind all non-alphas. ...
5
votes
2answers
2k views

Encryption/decryption of data

I'm trying to work with some encryption/decryption of data. It was some hard work for me to get it working with some buffers and what not. This is the code I came up with: ...
3
votes
2answers
222 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
3answers
10k views

AES encryption in PHP

PHP doesn't have a built-in functions for AES (specifically, AES-128) encoding/decoding, so I've had to implement my own, and this is what I have come up to (of course, taken from different many ...
2
votes
1answer
6k views

XECryption encryption and decryption script

The encryption script: ...
5
votes
1answer
17k views

DES, Triple DES and AES-128 code in Java

I wrote below code to crypt and decrypt some bytes in three algorithm with Java but I do not know if I wrote them in correct mode or not. Please tell me about truth of code. First class: ...
5
votes
1answer
460 views

Forming word combinations from file

I am looking for ideas to optimize the below code for speed. I'm also looking for some good improvement in execution time. This code reads a text file. The text file has many lines of ASCII text. ...
4
votes
1answer
2k views

A random relative prime number based on the modulus

I am implementing RSA in java using BigInteger and I have a method to return a random relative prime number based on the modulus m. The method looks like this: ...
4
votes
1answer
1k views

Cryptographic key exchange

I initially posted this on StackOverflow, and was redirected here. I have been playing around with Bouncy Castle (Java) for the last few days, and I've reached the point where I believe I can securely ...
4
votes
1answer
585 views

Finding a cryptoarithmetic solution

This code is intended to find all possible solutions to a cryptoarithmetic problem. The description of the problem I was trying to solve is here: In cryptoarithmetic problems, we are given a ...
12
votes
2answers
1k views

PHP mcrypt AES encryption wrapper

There are two keys: the main is aes128 and the second is XTEA, used just for randomization of data inside the AES. Randomization is done with secret random key that is not know even if someone knows ...
5
votes
1answer
714 views

AES encryption wrapper

After taking into account answers for my questions here and here I created (well may-be) improved version of my wrapper. The key issue was what if an attacker is knowing what is encoded - he might ...
20
votes
3answers
506 views

Encryption functions based on mcrypt

I learned here that it is unsafe to design encryption algorithms from scratch. Given that advice, I made a pair of encryption functions based on mcrypt: ...
27
votes
5answers
21k views

Tiny Encryption Algorithm (TEA) for arbitrary sized data

The TEA is a very simple encryption algorithm requiring little time and space - perfect for embedded systems. There are extensions to it, and every version has its flaws (WEP was based on it), but ...