A5/1 security algorithm - encryption

I want the encryption and decryption algorithm for A5/1 security code. Where can find these codes.

The wikipedia article ( http://en.wikipedia.org/wiki/A5/1 ) was recommended to my as being a reasonable description by my flatmate whom is currently undertaking a masters in security and digital forensics.

Here is an implementation in C of the A5/1 and A5/2 encryption algorithms by Marc Briceno, Ian Goldberg, and David Wagner. A5/1 and A5/2 are XOR-based stream ciphers, so encryption and decryption are the same operation:
A pedagogical implementation of the GSM A5/1 and A5/2 "voice privacy" encryption algorithms.
Note the warning from the authors:
The source code below is optimized for instructional value and
clarity. Performance will be terrible, but that's not the point.

The source code below is optimized for instructional value and clarity:
http://www.scard.org/gsm/a51.html

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.

Format-preserving encryption with Crypto++

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.

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.

Home-Made Cryptography [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 12 years ago.
Improve this question
I know you should never make your own cryptography, whether it is a cipher or hashing algorithm or even a secure pseudo random number generator these things I developed over a long standardisation process. However what I'm looking for quotes or good point in order to quickly describe/argue this to the occasional developer that decides to write their own cryptographic algorithm.
You can tell this developer that existing algorithms such as AES have been analyzed by countless experts in cryptanalysis (which would certainly involve an advanced understanding of numbers and computer science) and tested in competitions, where there's a real incentive for creating secure algorithms.
You can also tell this developer that just because an algorithm is popular, it doesn't mean that it's insecure (if that was this developer's rationale). Just because lots of people know how door locks work doesn't make door locks insecure, nor is it a good justification for people to create their own door locks.
For a real world example, see this TDWTF article about Nintendo's bug in the Wii's security functions. Nintendo (a big, well-known company with plenty of programmers) tried to implement an existing algorithm and managed to screw that up. What makes this developer think that he/she has the l33t h4x0r skills to write a new, secure algorithm?
Anyone who thinks they have devised an
unbreakable encryption scheme either
is an incredibly rare genius or is
naive and inexperienced.
Unfortunately, I sometimes have to
deal with would-be cryptographers who
want to make "improvements" to PGP by
adding encryption algorithms of their
own design.
I remember a conversation in 1991 with
Brian Snow, a highly placed senior
cryptographer with the NSA. He said he
would never trust an encryption
algorithm designed by someone who had
not "earned their bones" by first
spending a lot of time cracking codes.
That made a lot of sense. I observed
that practically no one in the
commercial world of cryptography
qualifies under this criterion. "Yes,"
he said with a self-assured smile,
"And that makes our job at NSA so much
easier." A chilling thought. I didn't
qualify either.
Philip Zimmermann, Beware of Snake Oil
Just tell them that unless they have several decades of experience in math, computer science and cryptography, and then a few years to design the algorithm, it is highly unlikely that they will be able to produce a better cryptographic encryption scheme than the ones that already are in widespread use, all of which have been worked on by a lot of people, many of which almost definitely have the background I described above.
Point the non-believer to these URL's:
Security Pitfalls in Cryptography By Bruce Schneier
Cryptography from princeton.edu
Homebrew Cryptography
Wikipedia Article on Cryptanalysis
As others have mentioned, you can use just about anything that Bruce Schneier says as a quote! He frequently mentions that anyone can create a cipher that he or she cannot break. He's expounded on this in detail but I can't find the article atm, but here's some essays of his that touch on this area:
Why the Worst Cryptography is in the Systems that Pass Initial Analysis
So, You Want to be a Cryptographer
yes thats true.. but all in all encryption is scrambling and substitution. so you can make your own cipher easily.. scramble your text using basic XOR and use a dictionary for substitute.
http://en.wikipedia.org/wiki/XOR_cipher
Hope this can help
Regards.

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