cipher

Code Golf - Word Scrambler

Please answer with the shortest possible source code for a program that converts an arbitrary plaintext to its corresponding ciphertext, following the sample input and output I have given below. Bonus points* for the least CPU time or the least amount of memory used. Example 1: Plaintext: The quick brown fox jumps over the lazy dog. ...

Verify key is correct using pyCrypto AES decryption

How do I verify the correct key is being used to decrypt AES encrypted data using pyCrypto AES? cipher = AES.new(key, AES.MODE_CFB) cipher.decrypt(s) If an incorrect key is used, it still attempts to decrypt the data, obfuscating it more. Is there any test I can do to prove the data is being decrypted to the original state? ...

How do I use the DES Algorithm in .NET?

How do I use DES in .NET? Here's how I'd do it in Java: public static String decrypt(byte[] pin, byte [] desKeyData ) throws Exception { //if (ISOConstantsLibrary.DEBUG) System.out.println("original: " + pin + " key: " + ISOUtil.bcd2str(desKeyData, 0, 2 * desKeyData.length, false) ); String out = ""; try { ...

Implementing XOR in a simple image encryption method.

So with the help of you guys I finished creating my very simple image encrypter. It's enough to keep any non-tech person out, right? :P Now to the next step. Someone suggested I use XOR. I read about XOR and it's basically a logical table that determines what the answer is between two bits, right? Only when one is true, the statement i...

Good list of weak cipher suites for JAVA

I'm running a server that requires a blacklist of weak cipher suites. So which of the following are weak? http://java.sun.com/javase/6/docs/technotes/guides/security/SunProviders.html#SunJSSEProvider ...

AES 128 Encryption for iPhone HTTP Stream

Hello, I know almost nothing about cryptography, but I would like to figure out how to encrypt an HTTP live stream and decrypt it on an iphone. The apple docs for HTTP encryption read as follows: //////////////////////////// Media files containing stream segments may be individually encrypted. When encryption is employed, references ...

How to validate javax cipher key?

I'm an android developer trying to use the javax.crypto package to encrypt/decrypt my SQLite database backups when I put them on the SD Card. That way, they can't be read while they're in the publicly accessible file system. I can encrypt/decrypt the file just fine, but I have no idea how to tell if the user input the right key or the ...

how can I encrypt a 300-bit plaintext using a block cipher with a block size of 128 bits in ECB mode.

how can I encrypt a 300-bit plaintext using a block cipher with a block size of 128 bits in ECB mode. ...

Using blowfish encryption with Android?

I'm trying to use a blowfish cipher inside an Android application. It appears that the Android platform supports blowfish (it appears to be in the source code), but when I try to get a cipher using: Cipher.getInstance("blowfish"); I get a "java.security.NoSuchAlgorithmException" ...

Java: Cipher package (encrypt and decrypt). invalid key error

Hello folks, i am doing a class with static methods to encrypt and decrypt a message using javax.crypto. I have 2 static methods that use ecipher and dcipher in order to do what they are supossed to do i need to initialize some variables (which are static also). But when i try to use it i get InvalidKeyException with the parameters i giv...

Characteristics of an Initialization Vector

I'm by no means a cryptography expert, I have been reading a few questions around Stack Overflow and on Wikipedia but nothing is really 'clear cut' in terms of defining an IV and it's usage. Points I have discovered: An IV is pre-pended to a plaintext message in order to strengthen the encryption The IV is truely random Each message h...

Software tools to automatically decrypt a file, whose encryption algorithm (and/or encryption keys) isn't known?

I have an idea for encryption that I could program fairly easily to encrypt some local text file. Given that my approach is novel, and does not use any of the industry standard encryption techniques, would I be able to test the strength of my encryption using 'cracker' apps or suchlike? Or do all those tools rely on advanced knowledge ...

Cracking the Playfair cipher

I have the ciphertext and an encrypting program (with the key hardcoded in). How would I go about finding the key? Surely the availability of the encryptor must open up possibilities beyond brute-forcing it. ...

Caesar Cipher in Java (Spanish Characters)

I've reading this question, and I was wondering if Is there any way to consider the whole range of characters? For example, "á", "é", "ö", "ñ", and not consider " " (the [Space])? (For example, my String is "Hello World", and the standard result is "Khoor#Zruog"; I want to erase that "#", so the result would be "KhoorZruog") I'm sure my...

Discovering which SSL/TLS version and ciphers have been negotiated by a browser

Is there any way to discover from within a browser (any browser, with a plugin if required) which SSL/TLS version was used for an SSL session, and which ciphers were negotiated? Alternatively, does any one know of any convenient tools that will enumerate the supported ciphers and SSL/TLS version for a remote SSL server? ...

Cipher Text Stealing Algorithms - Which one is correct?

There are two algorithms presented in the web. In both the algorithms, the first part is the same... 1. Pad the last partial plaintext block with 0. 2. Encrypt the whole padded plaintext using the standard CBC mode. 3. Swap the last two ciphertext blocks. 4. Truncate the ciphertext to the length of the original plaintext...

Cipher.doFinal output size

I am doing AES CBC decryption in java using javax.crypto . I am using the following Cipher class methods: public final void init (int opmode, Key key, AlgorithmParameters params) method for initialization, final int update(byte[] input, int inputOffset, int inputLen, byte[] output) method for decrypting the data, and finally I call t...

Is this a known DES cipher? What DES cipher is it? DES-CTR?

import Crypto.Cipher.DES import struct def rol32(x, y): ret = ((x<<y)&0xFFFFFFFF)|((x>>(32-y))&0xFFFFFFFF) #print 'rol32', hex(x), hex(y), hex(ret) return ret def sub32(x, y): ret = (x & 0xFFFFFFFF) - (y & 0xFFFFFFFF) if ret < 0: ret += 0x100000000 #print 'sub32', hex(x), hex(y), hex(ret) return ret def mul32...

Java "no cipher suites in common" issue when trying to securely connect to server.

Hi, I have an issue when a client (not mine) connects to my server securely. It seems that the connection is being refused on the basis of mismatching ciphers, but I have verified that the server indeed shares some of the ciphers with the client. Could it be an issue with the unknown cipher (Unknown 0x0:0x60)? If so, what must I do t...

Configure JBoss 4.2.3.GA to remove weak & medium ciphers

Hi, I hoping someone could help related to configuring JBoss 4.2.3.GA to disable weak & medium ciphers. We've scanned JBoss with Nessus and it identified weak & medium ciphers on port 8443. I was able to remove those scan results by limiting the ciphers. I added the following to the connector in server.xml ciphers="SSL_RSA_WITH_RC4_...