Whats an easy way to use AES in C? i see a lot of C++ examples and java...

John Morgan
John Morgan

whats an easy way to use AES in C? i see a lot of C++ examples and java examples but nothing in C that ive found. i want to write a program to encrypt a text file with a key. that's basically it. i don't really know much about encryption so im kinda just looking for a header i can import some functions from.

Attached: proud-heavy-weighted-anonymous.jpg (46.61 KB, 600x450)

Other urls found in this thread:

github.com/TokTok/c-toxcore/issues/426
github.com/gpg/libgcrypt

Henry Flores
Henry Flores

man 3 crypto

Luis Flores
Luis Flores

Never mind, that's erlang man page

Aiden King
Aiden King

#include <openssl/aes.h>

Aaron Foster
Aaron Foster

but is it cross platform?

Joseph Martin
Joseph Martin

man 1 gpg
Don't write your own if you can avoid it.

Elijah Stewart
Elijah Stewart

Is openssl cross-platform nigger?

Dominic Brooks
Dominic Brooks

This. You're more than likely going to do it wrong OP, because by your admission, you don't know anything about encryption. Do you know what an Initialization vector is? If no, then use an existing tool. Revisit the matter only once you've studied crypto.

Aaron Gutierrez
Aaron Gutierrez

libgcrypt
and it comes with all these neat features enabled by default

Libgcrypt makes use of certain hardware features. If the use of a feature is not desired it may be either be disabled by a program or globally using a configuration file. The currently supported features are

padlock-rng
padlock-aes
padlock-sha
padlock-mmul
intel-cpu
intel-fast-shld
intel-bmi2
intel-ssse3
intel-pclmul
intel-aesni
intel-rdrand
intel-avx
intel-avx2
intel-rdtsc
arm-neon

intel-rdrand and intel-aesni are especially useful for ultrasecure crypto

Aiden Bennett
Aiden Bennett

It doesn't matter how secure your library's features are, if you don't know what you're doing you can still make something insecure out of it without meaning to.
Correct crypto is hard. Don't tell people that using the right library will let them make something """ultrasecure""".

Luis Perry
Luis Perry

From your post I can tell you do not even know what AES is. Please do more research on what you actually want.

Jonathan Jackson
Jonathan Jackson

taking the bait

Logan Cook
Logan Cook

OP, I keep hearing this all the time with crypto.
It's too hard.
Don't do it.
You don't know what you are doing.
If you don't fuck around and screw up, you aren't going to learn anything.

Aiden White
Aiden White

make sure this goes in your code if you do this otherwise cryptojews on github will bully you
github.com/TokTok/c-toxcore/issues/426

Attached: requirement.png (63.12 KB, 794x817)
Attached: requirement2.png (9.92 KB, 400x50)

Nathaniel Foster
Nathaniel Foster

and screw up
It's hard to know if you've screwed up though. For example, if you didn't know what a timing attack was, you might not notice a screw up by using an operation which does not take constant time.
Another problem is when people create their own crypto scheme which they think is better than xyz. Without having studied cryptography it is very easy not realize how dumb what you came up with is.

Grayson Powell
Grayson Powell

Fucking around is fine, just don't use your own code in any situation where you need security.

Aaron Young
Aaron Young

Not a problem.
If someone is programming and doesn't know about race conditions, then they still have room to learn. I am not suggesting OP to release his software publicly, and OP doesn't seem to suggest that. If he wants to learn, then I encourage that.
Don't see why OP shouldn't use his own code if he is trying to learn.

Jacob Wood
Jacob Wood

it's that autistic "secure PHP cryptography" guy again
wew

Adam Kelly
Adam Kelly

underage channers try to write crypto
lol. Tox has always been an awful meme.

Jackson Sullivan
Jackson Sullivan

race conditions
At least when you are running into race conditions, you might notice your program behaving wrong. With a poor cryptographic implementation, it might be built to spec, but is vulnerable to an attack.
I would rather encourage actually learning some cryptography before trying to implement something. For example, if the OP just used AES to encrypt 16 bytes (128 bits), it would be bad. You can just do the inverse of AES to recover those 16 bytes.

Sebastian Powell
Sebastian Powell

i can't use that because it's a linux lib. im writing this for windows.

Jeremiah Parker
Jeremiah Parker

your fucked then
https://msdn.microsoft.com/en-us/library/windows/desktop/aa376210(v=vs.85).aspx
enjoy this documentation about the windows crypto api.

Alexander Cox
Alexander Cox

or actually, openssl is cross platform and so is libgcrypt

To build libgcrypt for Microsoft Windows, you need to have the
mingw32 cross-building toolchain installed. Instead of running a
plain configure you use

./autogen.sh --build-w32
make
make install

github.com/gpg/libgcrypt

i would just ignore the windows crypto api garbage.

Owen Mitchell
Owen Mitchell

I would rather encourage actually learning some cryptography before trying to implement something.
How do you learn without doing?

John Sanchez
John Sanchez

now this is what im looking for. thanks.

i already have mingw32 gcc installed so i might be able to use this.

Sebastian Evans
Sebastian Evans

Because you learn by studying the mathematics behind it.

Justin Cook
Justin Cook

as far as i can tell crypto is for math wizards. i was never good at math myself and the programs i generally write only require basic math.

Wyatt Hernandez
Wyatt Hernandez

Go to school, or get some textbooks and teach yourself. There isn't a good alternative if you want a compressive understanding of the subject. You can pick some stuff up by bouncing around, but you'll find that your understanding has holes in it.

Dominic Diaz
Dominic Diaz

pay the jew
you don't need any of this, all of the documentation is freely available. do not pay a dime unless you really want that piece of paper, it looks good on the resume, but as far as learning goes it's worthless.

Zachary Smith
Zachary Smith

It's an option for people who don't have the motivation to work through the material themselves.