[ / / / / / / / / / / / / / ] [ dir / cyber / hikki / imouto / leftpol / lovelive / polk / vg / zenpol ][Options][ watchlist ]

/tech/ - Technology

You can now write text to your AI-generated image at https://aiproto.com It is currently free to use for Proto members.
Name
Email
Subject
Comment *
File
Select/drop/paste files here
* = required field[▶ Show post options & limits]
Confused? See the FAQ.
Expand all images

[–]

 No.886774[Watch Thread][Show All Posts]

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.

 No.886787>>886790

man 3 crypto


 No.886790

>>886787

Never mind, that's erlang man page


 No.886791


 No.886795>>886797

#include <openssl/aes.h>


 No.886797>>886828

>>886795

but is it cross platform?


 No.886825>>886834

man 1 gpg

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


 No.886828

>>886797

Is openssl cross-platform nigger?


 No.886834

>>886825

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.


 No.886851>>886853 >>886937

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


 No.886853>>886859

>>886851

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""".


 No.886854

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


 No.886859

>>886853

>taking the bait


 No.886860>>886870 >>886872 >>886875

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.


 No.886870>>886885 >>886920 >>886926

File (hide): 047af77e5bef37a⋯.png (63.12 KB, 794x817, 794:817, requirement.png) (h) (u)

File (hide): 7c234b5dcc99ec5⋯.png (9.92 KB, 400x50, 8:1, requirement2.png) (h) (u)

>>886860

make sure this goes in your code if you do this otherwise cryptojews on github will bully you

https://github.com/TokTok/c-toxcore/issues/426


 No.886872>>886885

>>886860

>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.


 No.886875>>886885

>>886860

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


 No.886885>>886931

>>886870

Not a problem.

>>886872

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.

>>886875

Don't see why OP shouldn't use his own code if he is trying to learn.


 No.886920

>>886870

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

wew


 No.886926

>>886870

>underage channers try to write crypto

lol. Tox has always been an awful meme.


 No.886931>>886960

>>886885

>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.


 No.886937>>886948 >>886955

>>886851

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


 No.886948

>>886937

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.


 No.886955>>886961

>>886937

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

https://github.com/gpg/libgcrypt

i would just ignore the windows crypto api garbage.


 No.886960>>886968 >>887025

>>886931

>I would rather encourage actually learning some cryptography before trying to implement something.

How do you learn without doing?


 No.886961

>>886955

now this is what im looking for. thanks.

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


 No.886968>>886969

>>886960

Because you learn by studying the mathematics behind it.


 No.886969

>>886968

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.


 No.887025>>887070

>>886960

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.


 No.887070>>887076

>>887025

>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.


 No.887076

>>887070

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




[Return][Go to top][Catalog][Screencap][Nerve Center][Cancer][Update] ( Scroll to new posts) ( Auto) 5
30 replies | 1 images | Page ???
[Post a Reply]
[ / / / / / / / / / / / / / ] [ dir / cyber / hikki / imouto / leftpol / lovelive / polk / vg / zenpol ][ watchlist ]