-1

Is there a file (in /dev perhaps) that allows me to compute AES or SHA1 on data? There are analogs like /dev/urandom /dev/zero etc.

It would work like this: open said file, write data to it and read results out of it. Using sendfile syscall would be useful here as well, copying data directly within kernel space.

ArekBulski
  • 4,520
  • 4
  • 39
  • 61

1 Answers1

1

Not as a device node. There is an interface to the kernel CryptoAPI, but it's through netlink (AF_ALG). More information is available in the Linux kernel documentation.

However, it is rarely useful unless you have a hardware crypto accelerator which is only available from the kernel. The overhead of system calls will often make this interface much slower than performing crypto operations directly in your process.