Questions tagged [aes]

Advanced Encryption Standard (AES) is a cryptographic block cipher algorithm.

Filter by
Sorted by
Tagged with
2
votes
2answers
3k views

C# AES256 CBC Implementation

I was looking for a proper implementation of the AES256 encryption in C# but didn't find anything I was entirely satisfied with, so I decided to take this opportunity to write a class myself and maybe ...
1
vote
1answer
71 views

Power 8 AES implementation using built-ins

I need a review of an AltiVec/Power 8 AES implementation using built-ins to access in-core crypto. The program below is an implementation of FIPS 197, Appendix B. The hard-coded values are due to the ...
5
votes
1answer
8k views

Encrypt and decrypt a message using AES-256 with GCM mode using Bouncy Castle C# library

Goal: Given a plaintext message and 256 bit key, encrypt (and subsequently decrypt) the message using a 12 byte IV (in this case null bytes for simplicity, should not do this, I know) with MAC of ...
2
votes
0answers
411 views

Partial file encryption with AES

Task is to encrypt part of the file using aes encryption algorithm. I did ...
5
votes
1answer
4k views

Bouncy castle 128bit AES/CBC/PKCS7 in java

I have been trying to do some encryption-decryption using bouncy castle and with the available docs and samples on the internet I have managed to prepare the below. Though this works without throwing ...
6
votes
2answers
4k views

Encrypting files in a directory (AES)

I am quite new to Python (and programming in general). I was trying to create a command-line program for encrypting my files. Please tell me what I can improve (styling, crypto, etc.) Disclaimer: I ...
1
vote
1answer
286 views

CRT mode for AES

I needed to implement CRT mode for AES and coded following codes. But I am not an expert so I want to know experts comments that is it right or I made some mistake that will cause security problem. I ...
1
vote
2answers
12k views

AES Encryption/Decryption of Files and Bytes

I have gathered some information about aes256 in c# from the internet and put together this code and I would like to know if this is secure or if its lacking in security. Working encrypt/decrypt ...
3
votes
2answers
2k views

Sending a file over a socket with AES encryption

I'm not sure what's the best way to deal with streams that need to be closed whenever I'm done using them? Usually the need to also catch the exception inside the ...
1
vote
1answer
131 views

AES Java security

I am new to security and I was wondering if I can make my program better by changing or adding something to make it better/secure. Should I use a keyGenerator? I have my doubts from my program output....
2
votes
0answers
752 views

Wrapper/abstraction for encryption and decryption using OpenSSL

I am a beginner when it comes to cryptography and OpenSSL. I have written a short wrapper of some functions in OpenSSL as well as a test of this wrapper, copied below. Specifically, this code is ...
6
votes
1answer
2k views

AES encryption/decryption using pure .NET and streams

I'm trying my hand at simple encryption and decryption. Ideally I'd like to be doing it the 'right' way, ie something secure without doing it in a way that will have a serious hole. I'd prefer to do ...
7
votes
2answers
12k views

AES256 Implementation

I coded a little implementation to encrypt and decrypt bytes with AES256 (ECB) in C#. I wanted to know if I can optimize/cleanup my code a bit more, or if it i fine like this: ...
2
votes
1answer
116 views

Need help to make a more secure AES class

I've been working on my first "big" project in java, an AES encryption and decryption class, it's now working but i don't know how to improve my code. Also i'm not the best in security and I have no ...
3
votes
1answer
2k views

Making AES encryption in Go just a little easier

AES encryption in Go is already pretty simple, Gencrypt is a package that acts as a wrapper around Go's standard packages used for AES encryption to make it even more simple. https://gitlab.com/...
4
votes
0answers
1k views

Encode object to JSON and encrypt with AES (with tests)

While the task at hand is relatively straightforward, it turned out AES in Go is a bit clunky so I was wondering if this seems right. Also, any tips on Go coding in general are more than welcome. <...
6
votes
1answer
6k views

C# AES Encryption random IV per file

I've made some improvments on the code from : Csharp-AES-bits-Encryption-Library-with-Salt saltBytes is now the SHA512 of the password. Random IV for each encryption call. ( IV length 16 is added to ...
2
votes
1answer
83 views

Encrypting a user's file with a key that isn't stored but only known by the user

I want to make some kind of file vault. I want to store encrypted files in a MySQL table, and the key to encrypt/decrypt them is never stored but only known to the user (that's the goal, anyway). The ...
3
votes
1answer
242 views

Encryption functions intended for production

I want to know if these encryption functions are ok for a live production application. Based on resources here and here and here I have put together these three functions. Purpose This code is for a ...
4
votes
1answer
309 views

AES Encryption/Decryption

Where I currently work I'm tasked with writing a good encryption and decryption code which will have DEK as well as KEK. Haven't started on KEK yet. I have already told them, that we need expert help, ...
4
votes
1answer
1k views

Implementing RSA-AES encryption protocol

I am trying to write a simple program that allows to encrypt a string of plaintext so that it can be transmitted via an "insecure channel" by which I mean a "regular chat"; be it Skype, Facebook, or ...
2
votes
1answer
8k views

AES-128 Encryption/Decryption of NSData

I recently found an Objective-C extension on NSData that encodes and decodes data with AES-128. I made an attempt to port this code to Swift 2.2: NSData+AES.swift ...
3
votes
2answers
625 views

AES class security

I am using the AES class (which I think I got from another post on Stack Overflow) for encrypting strings to a database. How robust and secure (would it be easy to break) is this class? Is there any ...
3
votes
2answers
274 views

Intel® TinyCrypt: AES-128/CTR to encryption/decryption of 2D arrays

I need to encrypt/decrypt 2D arrays (double pointers) using AES-128/CTR using Intel TinyCrypt (written in C). The following are two helper methods to simplify the library usage. Any comments would be ...
8
votes
3answers
4k views

Implementing AES encryption in Java

I'm not a security expert, but while checking over our AES implementation for our flagship product, I've noticed some strange things, like the output length having a relation with the input length and ...
5
votes
1answer
907 views

PyCrypto AES-256 CTR wrapper secure for public use?

I have tried to write a more user-friendly AES CTR wrapper with PyCrypto, but I'm not sure if it's safe enough. I mean, by default there is IV=1 for CTR and in documentation it's said that IV is ...
4
votes
1answer
52 views

AES Wrap function

This code is supposed to implement RFC 3394 which also described in this PDF at page 11. Are there any weak places or formatting issues in attached source? Or maybe some places are not explicit ...
3
votes
2answers
209 views

File-encryption utility application

I made a simple file-encryption utility application for a little school project. I'm really interested in cryptography, and tried my best while making it. Can you see it, and give me feedback? The ...
0
votes
1answer
1k views

AES 256 FIPS compliant encryption + HMACSHA256

I created an Encryption class that encrypts data and decrypts it using the AesCryptoServiceProvider class with an HMACSHA256 ...
2
votes
0answers
87 views

Rijndael key expansion

I am writing Rijndael for academic purpose, following wikipedia's description. https://en.wikipedia.org/wiki/Rijndael_key_schedule I would like to know, if up to this point it is correct, both from ...
4
votes
2answers
3k views

AES and RSA using javax.crypto

So I am assuming that I did something wrong, and my AES and RSA encryption and decryption classes are insecure. I plan on using them for a larger project, and want to make sure I didn't completely ...
3
votes
1answer
661 views

Encrypt and Decrypt

I just want to know if my code can be weak. Can anyone also spot a mistake in my code? Encrypt ...
-4
votes
2answers
363 views

Saving encrypted files

...
10
votes
3answers
7k views

VB.NET code to AES encrypt and decrypt

I wrote this for use internally at work and have never worked with encrypted data before, so can you please critique? It's written in VB.NET which I have decent experience in, just not the encryption ...
5
votes
1answer
1k views

Implementation of AES using CUDA

I am trying to implement AES on GPU using CUDA programming. I use 4 TBoxes in my implementation that requires 4kB of GPU Memory. I have used a 1KB array for 1KB plaintext. first all of plaintext would ...
6
votes
3answers
3k views

BouncyCastle Diffie Hellman

I want to write a complete diffie Hellman example for bouncy castle that includes key generation, key exchange, encryption, and decryption. I also want to verify that if Alice is initiating a ...
5
votes
2answers
726 views

An AES Cryptography Wrapper

I built this wrapper over the System.Security.Cryptography.Aes encryption/decryption so that one need only instance the class and call the appropriate methods. This makes it much simpler to work with ...
4
votes
2answers
595 views

Encryption wrapper

I am writing an encryption class using Crypto++. The idea is that the client connects using RSA (encrypt, decrypt) with username, password, 32 byte key. The server will then return using the stream ...
13
votes
3answers
3k views

AES implementation

We are using an outdated 3DES algorithm for encryption and I have been tasked with writing a new implementation using AES with a 128bit shared secret. I would like to know if there are any security ...
5
votes
1answer
634 views

Mifare AES-128 symmetric key diversification

I have implemented a symmetric (AES 128-bit) key diversification algorithm for Java following the NXP Notes. It works as expected but am not the best Java programmer around, I guess I have done quite ...
2
votes
2answers
4k views

AES-encrypted key store

I am writing a program that needs to retain specific data but that should not be easily readable. I am in no way very skilled in crypto but I wrote this class that takes all of the data in and then ...
18
votes
2answers
17k views

C# AES + RSA Encryption Implementation

I've put together an AES encryption implementation to solve a set of requirements. I believe that I've met the requirements, but I'd like to see if anyone is willing to review the implementation to ...
9
votes
2answers
28k views

C# AES Encryption

I've been researching AES encryption a bit over the past several days. The official (MSDN) examples I've seen are encrypting and decrypting using the same AES instance. They don't go in to what to do ...
4
votes
1answer
590 views

AES encryption class

I am new to encryption and recently wanted to learn more about it. I researched how to do AES Encryption in java and assembled my own Java AES encryption class. I don't know if there are any major ...
5
votes
2answers
26k views

Encrypt and decrypt a serializable object

I want to make sure that the code I have for encrypting and decrypting a serializable object makes sense and is proper. Does it look right too? Here's what I have so far: ...
0
votes
1answer
4k views

256 bit AES encryption in Android

I am using the following code to encrypt a file in an SD card in Android: I want the code to be reviewed for: Security (prioritize this) Coding Style Performance ...
5
votes
2answers
5k views

AES CTR mode using pycrypto

I've implemented CTR mode by myself (only decryption for now), using only AES built-in functions from pycrypto. It means that I'm not supposed to use mode=AES.MODE_CTR. However, I know that using AES....
5
votes
1answer
7k views

Encrypt Using AES

I'm using Microsoft's example for encrypting/decripting a string. In their example, they are using Tripple DES. I'm trying to convert their code to use AES. The modified code, listed below, works. ...
6
votes
2answers
18k views

AES Encryption C# .NET

I have written a tool for encrypting string using the AesCryptoServiceProvider in .NET. The folllowing parameters are used: Block Cipher Mode: CBC Initialization Vector: 16 bytes (randomized per ...
3
votes
1answer
7k views

AES-128 encrypt/decipher class

For the past few days I've been working on a AES-128 encrypt/decipher class. I needed something very scaled down from Cryptolib so that I didn't have to constantly ...