[Cryptography-dev] AES-CTR with 256 bit keys

2023-02-02 Thread Arshad Khan
Hello I have a question regarding AES in python cryptography which uses a block size of 128 bits. Currently I am using 256 bit keys with AES in CTR mode. However, internally the python cryptography uses a block size of 128. My understanding is that block size and key size are the same for symmetri

Re: [Cryptography-dev] AES-CTR with 256 bit keys

2023-02-02 Thread Alex Gaynor
This is not correct, block size and key size are not the same thing for symmetric encryption algorithms. AES's block size is always 128-bit, it's not something cryptography chooses to use, it's the definition of the algorithm. Alex On Thu, Feb 2, 2023 at 8:02 PM Arshad Khan wrote: > > Hello > >

Re: [Cryptography-dev] AES-CTR with 256 bit keys

2023-02-02 Thread Arshad Khan
Thanks Alex for the quick reply. So in my case it can be said that I am using AES-256-CTR cipher? Because I was calling it AES-128-CTR and people were asking me why I am using a smaller key. On Fri, Feb 3, 2023 at 9:09 AM Alex Gaynor wrote: > This is not correct, block size and key size are not

Re: [Cryptography-dev] AES-CTR with 256 bit keys

2023-02-02 Thread Alex Gaynor
In pyca/cryptography, one uses the AES() class and gets AES-128 or AES-256 depending on the key size: https://cryptography.io/en/latest/hazmat/primitives/symmetric-encryption/#cryptography.hazmat.primitives.ciphers.algorithms.AES You can also use the AES128 and AES256 types explicitly if you prefe

Re: [Cryptography-dev] AES-CTR with 256 bit keys

2023-02-02 Thread Arshad Khan
Thanks Alex for the reference and clearing my doubts. Seems like I should be using the term AES-256 in my use case. On Fri, Feb 3, 2023 at 9:15 AM Alex Gaynor wrote: > In pyca/cryptography, one uses the AES() class and gets AES-128 or > AES-256 depending on the key size: > > https://cryptography