Format-preserving encryption with Crypto++ - encryption

is it possible to perform FPE with the Crypto++ library?
Thank you

Is it possible to perform FPE with the Crypto++ library?
Well, it depends on how you define Format Preserving Encryption.
In A Synopsis of Format-Preserving Encryption, Phillip Rogaway stated: "... it is my view that the cryptographic literature already contains good solutions for FPE but that, at least until quite recently, the ideas were scattered about, not widely known, and not cohesively described."
If you are talking about Bellare, Spies and Rogaway's FFX mode of operation proposed to NIST circa 2010, then the answer is no. Crypto++ does not have FFX mode.

Related

Encryption algorithms in pseudo code

I have been reading up on encryption algorithms and am trying to implement them with my research without using any libraries. However, I am finding it a bit difficult to understand how they work.
The algorithms I have looking at in particular are,
triple des - uses 3 keys, 1st to encrypt, 2nd to decrypt and third to encrypt again
RSA - uses large positive integers to generate encryption and decryption e.g., e,d and n
AES - uses substitution permutation with fixed blocks of bits and key size.
I have searched online and came across many libraries like cryptoJS, OpenPGP and cryptico but am finding it hard to follow the code - because of being new to them.
I understand the main idea behind them but finding it difficult to put in code, please can someone guide me - is there any psuedo code/psuedo algorithm that I can use or make reference to when implementing.
I have implemented AES and DES on Java. For my experience, If you know theory everything is very simple. You can get MIT or Stanford course of cryptography. Anyway first off all you should know theory. After that there are too many implementations at Github. You may even use Youtube to see how algorithm encrypts on sample data.
To be honest I love resources of Ruhr University Bochum. AES/DES are chapter III, IV. This is official web page link. They have recorded video lectures and also free book, named "Understanding cryptography" published by Springer.
P.S BouncyCastle is very popular library. It is very well implemented on Java. You can look at this too.

Tools to practice cryptanalysis and cryptography techniques

I am looking for tools (preferably free) to practice various cryptoanalysis and cryptography techniques. Something along the lines of following two online tools but with more techniques.
http://www.cryptool-online.org/index.php?option=com_content&view=article&id=55&Itemid=53&lang=en
http://www.simonsingh.net/The_Black_Chamber/letterfrequencies.html
Any suggestions would be very welcome.
Thanks,
Ambi.
The Matasano Crypto Challenges are an excellent learning resource for cryptography.
We've built a collection of 48 exercises that demonstrate attacks on
real-world crypto.
This is a different way to learn about crypto than taking a class or
reading a book. We give you problems to solve. They're derived from
weaknesses in real-world systems and modern cryptographic
constructions. We give you enough info to learn about the underlying
crypto concepts yourself. When you're finished, you'll not only have
learned a good deal about how cryptosystems are built, but you'll also
understand how they're attacked.
The first couple of sets may seem a bit too easy for someone acquainted with cryptography, but the challenges quickly get more tricky and advanced.

Is there an ActionScript library for Twofish Encryption/decryption

Do you know a library in ActionScript 3 that can encrypt and decrypt using the TwoFish algorithm?
I have been using as3crypto for other cryptographic algorithms, but unfortunately, it doesn't seems to handle Twofish...
Thanks!
Unfortunately, I do not believe there is. I did a light search a little while back looking for such a library but there was not much. What I had planned on doing and what seems to be your best option, is to possibly roll your own? There are plenty of examples of implementation of the cipher that you can find through Google. I would go by a C# example and convert it over. Let us know if you do that so others can use it!
Twofish was Bruce Schneier's entry into the competition that produced AES. It was judged as inferior to an entry named Rijndael, which was what became AES.
However, there is a third-party encryption library for ActionScript that includes AES.
http://code.google.com/p/as3crypto/

Is there a better one ? Encryption -> AES. PRNG -> Blum Blum Shub?

Is there a better algorithm than AES-256 ?
AES is an industry standard symmetric algorithm. But theoretically its told to have flaws. Is there any symmetric algorithm (needn't be a standard), that's highly praised for its security? I'm collecting information on algorithms in-order to make a wallet to store some text for a specific device.
I read that Blum Blum Shub is a notable pseudo random generator algorithm, mainly used in cryptography rather than simulation. Here my focus is cryptography. So is it the best PRNG out there or is there any better one? I wanted to implement it for an ARM A8 Core CPU architecture in ARM assembly just from learning the asm, the architecture, and those algorithms in depth.
Does (or is it possible) using a gpu for encryption/decryption any better? My device in interest is N900 tablet (to learn more about the hardware and software).
It is true that AES is not the best and newest security algorithm but it may be the one with the ARM8 because it is part of the supply contract and may not be replaceable - it could be for compliance with FIPS standards in the US or the method the country or province of intended use has specified. You could do simple manipulate or substitute of text or numeric data yourself before sending it to AES and remember to write the code for the reverse process so you can reconstruct the data correctly and write, display or print it out.

How to identify encryption algorithm used in ciphertext?

Is there any ways to try to guess encryption algorithm used to encrypt the ciphertext?
Yes. There are some differences:
Is it a block cipher or not can be guessed from the length.
Block length
Entropy of the output (are all characters equally present? / can patterns be found?)
Recurrences (CBC or not...)
The entropy of the string is probably the best hint. A simple method to determine it is probably trying to compress it. Some methods can be found here: http://www.random.org/statistics/ They use them to make sure their numbers are as random as possible.
I've got no idea if it's really possible to determine the encryption using these methods.
Tools to see it:
PEiD with the Krypto Analyzer (KANAL) plugin
IDA Pro with the Findcrypt plugin
OllyDbg with the SnD Crypto Scanner
x3chun's Crypto Searcher
Keygener Assistant
Hash & Crypto Detector (HCD)
Draft Crypto Analyzer (DRACA)
but all to executables.
found here : http://fwhacking.blogspot.com.br/2011/03/bfcrypt-crypto-scanner.html
Quite often this information is readily available - in a good encryption scheme, only the key needs to be secret, not the algorithm used.
There are analyses you can can perform to test for particular encryptions, consult a textbook on cryptanalysis for details!
You can try fbcrypt which will scan for known hash & crypto signatures: http://fwhacking.blogspot.com/2011/03/bfcrypt-crypto-scanner.html
For now it supports MD5, CRC32, Blowfish, DES and SHA256, but more will be added soon. Anyway as the source is available you can also add your own.
It depends if you're talking about "raw encrypted data" (in that case you can use methods such as listed by "gs" in the other answer) or an encrypted file in some standard format (the most common are CMS/PKCS#7 and OpenPGP); in the latter case the encryption algorithm is explicitly indicated in the metadata contained in the very file.
For CMS you need an ASN.1 decoder such as command-line dumpasn1 program or my own web-based Javascript decoder while for OpenPGP you can use pgpdump.

Resources