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
1
vote
0 answers

Why does encrypting in one Java class and decrypting in another causes BadPaddingError?

I have a test function that returns a byte[] in one Java class, FirstClass: public static byte[] testA(){ CipherClass crypto = new CipherClass(); byte[] a = crypto.encrypt("helloWorld"); return a; } Where CipherClass…
Jae Bin
  • 49
  • 1
  • 2
  • 10
1
vote
2 answers

AES key length and block length

I have read that there is no corelation between the key length and the block length in AES. But it doesn't make sense to me, because the key will XOR the block, how they can be in different lengths?
Eran Nahshon
  • 29
  • 1
  • 6
1
vote
2 answers

Using CTR mode in DES algorithm (in python)

I want to use CTR mode in DES algorithm in python by using PyCryptodome package. My code presented at the end of this post. However I got this error: "TypeError: Impossible to create a safe nonce for short block sizes". It is worth to mention that,…
AI_Eng
  • 11
  • 2
1
vote
1 answer

Java: Which mode is by default set in Javax Cipher class?

I am working on securing a chat application written in Java (it is downloaded from the internet, and now I want to secure it in order to learn). I have read the documentation, but I am unable to figure out which mode of encryption is set by default,…
Bab
  • 433
  • 5
  • 12
1
vote
1 answer

AES 128 decryption with ciphertext shorter than key

We are developing an application that has to work with data that is enycrpted by LoraWan (https://www.lora-alliance.org) We have already found the documentation of how they encrypt their data, and have been reading through it for the past few days…
user1966576
  • 83
  • 1
  • 10
1
vote
1 answer

BlockCypher Send Transaction

I am trying to implement the BlockCypher Ethereum API following the docs here: https://www.blockcypher.com/dev/ethereum/#transaction-api I am using the Test Network /beth/test, rather than /eth/main. I successfully created 2 addresses and called…
noiseFree
  • 11
  • 2
1
vote
1 answer

Error in MATLAB implementation of present cipher key update

i am trying to implement PRESENT cipher in MATLAB but its not encrypting and decrypting correctly (i am not getting the plaintext after decryption). After testing each part of the cipher i.e sub layer, player, add round key and key update, i found…
1
vote
1 answer

RC-6 ciphertext does not match non 0 vectors

I came up to this problem where my RC-6 algorithm does not produce the cipher text it should (by the spec doc) well to be more clear, let me give you an example As you see when plain text and key are made out of zero-bytes it passes both tests ->…
Danielius
  • 165
  • 11
1
vote
0 answers

Elliptic Curve Cryptography in Web3 and Smart Contract

I have been trying to sign the data in Smart Contract by using the web3 library. I gave it a try on the truffle develop console, and I tried to retrieve back the address by using erecover in Solidity.Unfortunately, I couldn't get back the signed…
DavidB
  • 313
  • 1
  • 8
  • 23
1
vote
1 answer

Unable to decrypt the data in java which is encrypted in webcrypto api

I am generating key pair in java and encrypted some plain text in webcrypto API by using the public key. I am getting encrypted data is in Uint8Array format and trying to decrypt with my private key in java stand alone. Java Code: import…
1
vote
1 answer

Using hashing with padding and blockcipher modes

I am writing a cryptographie program and want to use several cipher block- and stream modes together with hashing mechanisms. I do not have any problems with encrypting, decrypting and verifying the message with stream modes like OFB, but I have…
Andrej Tihonov
  • 649
  • 2
  • 9
  • 21
1
vote
1 answer

Blockcypher Webhooks not working

i have created Webhook on blockcypher. HOOK :- { "id": "ddab39b1-fa67-4889-8159-d3003cd2ad2a", "token": "mytoken_hidden_for_security", "url": "https://requestb.in/1dgi1hr1?uniqid=594167735dfd3", "callback_errors": 0, "event":…
Shubham Panchal
  • 142
  • 2
  • 10
1
vote
2 answers

Java Encryption: What seed to use in my AES/CBC/PKCS5Padding scenario

I am building an app that will use AES/CBC/PKCS5Padding method to encrypt user's data on their device, and security is of high importance. I want to prevent brute force attack in case someone gets hold of the database. Each row in the table has an…
Shahid Thaika
  • 2,133
  • 5
  • 23
  • 59
1
vote
0 answers

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 those API and changes Cipher suites then other…
1
vote
1 answer

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 that after I'd performed my XOR Bitwise…
user50812
  • 13
  • 3