Newest 'block-cipher' Questions

Q&A for professional and enthusiast programmers

trying to implement Speck32/64 block Cipher

I am trying to implement Speck 32/64 block Cipher in c# I'm stuck at encryption decryption algorithm. i know that i should split the plain text in to 2 word according to algorithm x,y = plaintext ...

Does this code qualify to be a block cipher

Ok, before you guys reprimand me : I am aware this is a horrible code and super weak cipher. I just trying to find out if the following qualifies to be a block cipher ( even a very rudimentary and ...

What are the default cipher modes for .NET, Java, php and python?

I'm putting together a crypto document and I can't find documentation stating what the default cipher modes(ECB, CBC, etc..) are for .NET, Java, php and python. So pretty much if you don't define a ...

Python 24 bit Stream not giving a right value?

I am converting 3 letters into their ASCII binary notation and then incrementing the first letter by 16 places, the second letter by 8 places, and the last is staying where it is, so that when the 24 ...

Integrate custom block cipher in Java Card framework

I created some lightweight cipher in Java Card language and now I want to integrate them into the Java Card API.I noticed the javacardx.crypto.Cipher as well as javacard.security.Key classes. But it ...

How to properly work with file upon encoding and decoding it?

It doesn't matter how I exactly encrypt and decode files. I operate with file as a char massive, everything is almost fine, until I get file, which size is not divide to 8 bytes. Because I can encrypt ...

AES 256 Encryption/Decryption initialization vector confusion

Let me start by saying that I am new to the encryption arena. With that said, I am developing an application and need to store username, password and full name(first, middle, last) encrypted in a ...

What is the default IV when encrypting with aes_256_cbc cipher?

I've generated a random 256 bit symmetric key, in a file, to use for encrypting some data using the OpenSSL command line which I need to decrypt later programmatically using the OpenSSL library. I'm ...

How to detect block cipher mode

How to detect if a message was crypt by CBC or ECB mode? I have made a function who encrypt in AES 128 CBC or ECB randomly, and I do hamming between clear text and cipher text, but seams not ...

How can I disable 112 bits cipher suite in SSL of a java server

How can I disable insecure 112 bit cipher suite in a java application server, specifically these ones: TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA TLS_RSA_WITH_3DES_EDE_CBC_SHA ...

How to encrypt files with AES256-GCM in golang?

AES256-GCM could be implemented in go as https://gist.github.com/cannium/c167a19030f2a3c6adbb5a5174bea3ff However, Seal method of interface cipher.AEAD has signature: Seal(dst, nonce, plaintext, ...

Seeking help trying to solve classical pencil and paper cipher

I'm studying classic encryption ciphers. I've had success with Vigenere and Columnar Transposition ciphers both independently and combined when they are both applied over the same message with the ...

Anyone with a C#, Delphi or FreePascal implementation of the PRESENT Ultra-Lightweight Block Cipher encryption?

A short while ago a paper got published on PRESENT: An Ultra-Lightweight Block Cipher by Andrey Bogdanov et al becoming ISO standard 29192-2:2012. Is there anyone that has a C#, Delphi or FreePascal ...

One block cipher decryption with an AES and long key

I was given this key in hex String: "140b41b22a29beb4061bda66b6747e14" and requested to decrypt an one block cipher with an AES implementing a ECB. As we know, the key must be 16 bytes long. But the ...

Using Coldfusion's Encrypt function to encrypt a hex block and return a block-length result

My company is working on a project that will put card readers in the field. The readers use DUKPT TripleDES encryption, so we will need to develop software that will decrypt the card data on our ...

encryption algorithm block cipher and stream cipher

what is differance between stream cipher and block cipher?As in block cipher data are in chucks while in stream cipher bit by bit encrypting so how many data are as input in stream cipher?

cipher.doFinal(…) fails while cipher.update(…) succeeds

I am trying to decrypt a byte array using the following code. I left out exception handling and other practices for brevity: Cipher cipher = Cipher.getInstance("AES/CBC/PKCS7Padding"); byte[] key = ...

How can I add/ remove cipher suites from Schannel without affecting other processes?

How can I add/ remove cipher suites from Schannel by calling API "BCryptAddContextFunction" and "BCryptRemoveContextFunction" without affecting other processes? For example, if process 'A' calls ...

Key Interface & SecretKeySpec Concrete; Use Key or SecretKeySpec?

I've been writing javax.crypto.Cipher code and have had many questions answered by StackOverflow so I appreciate the information contained in this site. I did have a question I have not found an ...

Is there a protocol that uses MD5 Hashing?

I have a program that I am reverse engineering for learning purposes about protocols (and to sharpen my assembly skills). I have reversed the whole protocol, and know where encryption takes place and ...

AES-CCM encrypted message length

Explain me this please: I encrypted 1 byte plain text by AES-CCM with 8 byte MAC. Result is 9 byte long. I thought that AES is a 16 byte block cipher, so the result must be 24 bytes long, but it isn'...

AES-128 CBC decryption

I have written this code in java in order to decrypt a ciphertext. I have the key. Everything seems correct to me but I have the problem that I'm gonna explain. Here is my code: import javax.crypto....

Bouncy Castle AES Encryption - providing input in blocks

I'm using Bouncy Castle library to encrypt some data in my Windows Store App. My EncryptHelper class: public static class EncryptHelper { private const string KEY = "chiaveAES"; private const ...

Getting keystream - Java Decryption

I am using Java's Cipher class for decryption. Couple of questions: Using DES decryption with OFB, for a multi-part decryption, is it possible to generate keystream in the first iteration but not ...

Send IV encrypted or not? [closed]

I'm using CBC mode. I'm thinking of sending the IV encrypted in ECB mode(since it is only a block), instead of sending the "plain" IV. Will i gain some security?

Ciphertext stealing in Java

So I have a school project that I am having some trouble with. We are given the encrypt method and then asked to create a decrypt method for it. public static byte[] encrypt(byte[] plaintext, ...

Schannel Cipher Naming Convetion

I'm looking into disabling certain ciphers and I'm trying to wrap my head around how the block ciphers are named in Windows. Specifically what the numbers follow the name mean. For example, RC4 40/128,...

Discrepancy between RSA implementations

I'm not a crypto-guy so I know close-to-zero about these things. I must interoperate with a system using RSA cryptography. When using their keys, I'm running into the problem of getting different ...

Block Cipher Python unichr() output formatting Issues

I'm trying to write a python script that can encrypt and decrypt text using a block cipher, but I keep getting completely blank outputs. After trying to track down the source of the problem I realised ...

Proper way to add padding to byte slice in golang?

I'm trying to encrypt some data in go but it's hardly ever the correct cipher.BlockSize. Is there a "built-in" way to add padding or should I be using a function to add it manually? This is my ...

Block or Stream Encryption?

I want to know if data stored in encrypted form is encrypted by block-cipher or a stream-cipher? I have encrypted data, how do I check that it comes from a block or a stream cipher?

Passing gzencoded data to mcrypt_encrypt, can't unzip after decryption

To keep this short, are there known issues when passing results of gzencode (or other non-text data) to mcrypt_encrypt functions? Details: Basically I have an issue where encryption/decryption is ...

How to choose an AES padding mode? [closed]

Depending on the framework you are using, there are various padding modes that can be used with AES encryption. For example, with .NET we can choose PKCS7, ISO10126, ANSIX923, Zeros or None. Similar ...

System.IndexOutOfRangeException on input block cipher using c#

I try to do a binary input into a block cipher with 256 bit long, with its own pattern. using input class private string inputBinary(string binary_, string rule) { var positionArray = rule.Split(...

Understanding fitness function

I am working with use of genetic algorithm to break transposition cipher. So in this work I have come across to a paper named Breaking Transposition Cipher with Genetic Algorithm by R. Toemeh & S. ...

Block Cipher Algorithm

Can somebody provide me a good Block Cipher Algorithm with example. This is required for Data Masking of Strings. Algorithm should be fast and not easily reversible as this will be applied on millions ...

Crypto++ symmetric algorithms and authenticated block modes combinations

I've implemented a C++ wrapper library for Crypto++ v5.6.2 and have a question about combinations of symmetric algorithms (e. g. Blowfish) and block modes (e. g. GCM). I am able to encrypt and ...

AES Cipher - javax.crypto.IllegalBlockSizeException Input length must be multiple of 16 when decrypting with padded cipher

I created a class which encrypts and decrypts Strings using the AES Cipher. But when i run my encrypt method i get an javax.crypto.IllegalBlockSizeException error Complete Stack: javax.crypto....

Java crypto AES functions

As an exercise, I am implementing my own CBC and CTR modes. (e.g. for first block of CBC, E(k, IV xor message[0]). For example, I tried the following thinking that I can use that as my E function (...

Block ciphers, salt, AES, MySQL, and best practices around credential storage

I have a situation where I must store a password, as I am building a system to connect to another system. This other system only allows for a single user account, and the only way to connect to it is ...

Speck algorithm not working

I am trying to implement Speck 64bit block / 128bit key cipher in java. I'm stuck at encryption / decryption algorithm. My decryption algorithm can't decrypt cipher text properly. My implementation: ...

Is this AES encryption secure enough?

I got this code from http://www.ravenblast.com/index.php/blog/android-password-text-encryption/ and, although it works, I have a growing suspicion it's not secure enough. There isn't any ...

encrypt-decrypt single block with AES and Crypto++

I need to encrypt single block of AES. I cant use any modes like CBC and other. Every example what i have seen use streaming modes. EDIT: ok, i did it in the next manner, but i really dislike this ...

ECB, CFB, OFB cipher modes in Openssl

I know that when I use CBC mode with Openssl, I can give as an input which is a multiple of a block size. But how about other modes? ECB, CFB, OFB? I saw a doc but its not all clear to me. Should I ...

Threefish block cipher, ECB, .NET implementation: encrypted and decrypted (initial plaintext) strings' lengths are different

I am encrypting and decrypting a string in .NET, using ECB cipher mode and Threefish symmetric block cipher, whose implementation I've attached to my project as a .dll Here's the link to .NET ...

IllegalBLockSizeException when decrypting

I wrote an encrypt and a decrypt function. The encrypt works fine, but I always get IllegalBlockSizeException in the decrypt. public static String aes_encrypt (String text, String key) { ...

implement xxtea algorithm that accepts hex value [duplicate]

I have to encrypt a code with XXTEA algorithm. cipher = 16 byte key = 8 byte Example : key: 0xAA 0xBB 0xCC 0xDD 0xAA 0xBB 0xCC 0xDD 0xAA 0xBB 0xCC 0xDD 0xAA 0xBB 0xCC 0xDD msg : 0xFF 0xFF 0x87 0x30 ...

AES CTR mode with short messages

Is AES in CTR mode safe to use when encrypting short messages (less than a block size)? An example would be encrypting SSN or credit card numbers. I have seen conflicting information concerning this ...

Cipher Feedback mode c++ implementation

HI I am tiring to implement a CFB with DES. I think i am able to encrypt using with CFB but how can I decrypt?? My main issue is CFB code for encrypting using CFB correct ??. Due to the restriction I ...

c# format preserving encryption for integers

I have a requirement for generating numeric codes that will be used as redemption codes for vouchers or similar. The requirement is that the codes are numeric and relatively short for speed on data ...
Translating... 0%