Questions tagged [block-cipher]

A block cipher is a keyed bijective function (also pseudo-random permutation). If your question is not directly related to programming, check if the question fits better on https://crypto.stackexchange.com/ or https://security.stackexchange.com/

136 questions
0
votes
1 answer

How to combine hex value and keep it the same size?

so I pull random 256 bytes each from three different sources in hex value. x =…
longmne
  • 13
  • 4
0
votes
2 answers

Finding repetitions of a string by length

I have a string of letters similar to that shown below: 'ABTSOFDNSOHASAPMAPDSNFAKSGMOMAPEPTNSNTROMAPKSDFANSDHASOMAPDODDFG' I am treating this as a cipher text and therefore want to begin to find the position of repetitions in order to find the…
0
votes
1 answer

Errant segments in cellular automata encryption algorithm

I've been implementing a paper that is targeting IoT encryption using a 64-bit block cipher via elementary cellular automata. The paper is in the repository/linked in the README. I am trying to verify that an implementation of this algorithm…
0
votes
0 answers

GCMParameterSpec with tag length of 32 in Cipher

For algorithm test vector evaluation, I am trying to perform an AESGCM encryption and decryption with arbitrary tag length values such as 32 bits. When I try to initialize my cipher with such an arbitrary tag length as follows: final Cipher cipher =…
factor2
  • 155
  • 9
0
votes
0 answers

Cryptography - How to implement MARS with ofb mode?

I'm trying to find an implementation of the MARS algorithm with OFB operation mode in python for a project I'm working on and I can't find one that works. I found only an implementation of OFB mode in stackoverflow from Crypto.Cipher import AES from…
guy hazut
  • 21
  • 4
0
votes
1 answer

Strange problem with decryption of AES using OpenSSL, Gets padded with same looking junk, Base64 padding issue

Can someone tell me whats wrong with my code? It works fine in my test example.. but when I use it in production model it decrypts the string but adds a padded symbol to maintain some kind of block size or something. I didn't post my encrypt/decrypt…
SSpoke
  • 5,656
  • 10
  • 72
  • 124
0
votes
1 answer

"TypeError: Object type cannot be passed to C code when encrypting an image

I am trying to encrypt an image file, but when I try to execute my code, I get the error: TypeError: Object type cannot be passed to C code I will really appreciate any help on how to fix this error, I'm a beginner in using…
lilfavour
  • 1
  • 1
0
votes
0 answers

For a deterministic block cipher, can two different inputs ever produce the same output?

Take a block cipher with input K, M. I understand that block ciphers are deterministic and will always produce the same output X when given the same values for inputs K and M. However, given a block cipher with input K1, M1 and output X1 and one…
0
votes
1 answer

How to encrypt String using Camellia 128-bit Encryption Algorithm in Java?

Im currently trying to develop a chat application that implement Camellia 128-bit as its encryption algorithm. I succesfully build and run the code from it official page [here][1]. The problem is the algorithm encrypt for Integer datatype. When im…
0
votes
0 answers

Modified Skip32 to generate only obfuscated postive int in java?

The following implementation of Skip32 for java produces signed int(Skip32 impementation). Is there way to modify it so that only positive numbers are generated ? Or can one use the absolute value of the int generated(without worrying about…
0
votes
1 answer

convert mcrypt 3DES ECB to openssle_encrpt

I am converting MCRYPT ECB to open SSL ECB MCRYPT function public function encrypt($input) { $vi = base64_decode($this->iv); $key = mb_convert_encoding($this->key, "UTF8"); $key = md5($key,true); $key = $this->processKey($key); …
Leong
  • 139
  • 13
0
votes
0 answers

C returns unreadable string while decrypting message using openssl aes-128-cbc mode

I have one ciphertext, iv and a dictionary file including passwords, one of them has been used to derive a key for the decryption. Here is the C code using the brute force method. What problem I am facing is it's giving me many decrypted text which…
tanni
  • 3
  • 4
0
votes
1 answer

AES128 Encryption CBC/NoPadding Objective-C

We need to encrypt a request using AES128 in Android and IOS and then send that encrypted message in the backend server written in Java. Our Android encryption code is like below: Cipher cipher =…
NothingBox
  • 345
  • 5
  • 15
0
votes
1 answer

Reading one byte at once from file in python

I have to create a state array (4x4 matrix of 128bit in total, having each element of one byte) for implementing AES in python, how can I read one byte at a time from an input text file.
bhanu pratap
  • 626
  • 7
  • 10
0
votes
2 answers

AES 128 CTR plain text size not multiple of block size

I read that AES 128 CTR mode should work on blocks of 16 bytes (128bit), like CBC mode. indeed, if I try with openssl to encode 18 bytes plaintext with : max@jarvis:~$ printf 0123456789abcdefgh | openssl enc -e -nopad -nosalt -aes-128-cbc -K…
mastupristi
  • 1,240
  • 1
  • 13
  • 29