Skip to content

Commit f5893d8

Browse files
committed
Remove the crypto section due to poor maintenance
The past content in the crypto section lacks informative descriptions, and there should be a proper procedure to demonstrate how Linux cryptography works. Due to poor maintenance, let's drop the section.
1 parent 1d38d2e commit f5893d8

File tree

4 files changed

+0
-306
lines changed

4 files changed

+0
-306
lines changed

examples/Makefile

-2
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@ obj-m += sched.o
1818
obj-m += chardev2.o
1919
obj-m += syscall-steal.o
2020
obj-m += intrpt.o
21-
obj-m += cryptosha256.o
22-
obj-m += cryptosk.o
2321
obj-m += completions.o
2422
obj-m += example_tasklet.o
2523
obj-m += devicemodel.o

examples/cryptosha256.c

-68
This file was deleted.

examples/cryptosk.c

-199
This file was deleted.

lkmpg.tex

-37
Original file line numberDiff line numberDiff line change
@@ -1910,43 +1910,6 @@ \subsection{Bottom Half}
19101910

19111911
\samplec{examples/bottomhalf.c}
19121912

1913-
\section{Crypto}
1914-
\label{sec:crypto}
1915-
At the dawn of the internet, everybody trusted everybody completely\ldots{}but that did not work out so well.
1916-
When this guide was originally written, it was a more innocent era in which almost nobody actually gave a damn about crypto - least of all kernel developers.
1917-
That is certainly no longer the case now.
1918-
To handle crypto stuff, the kernel has its own API enabling common methods of encryption, decryption and your favourite hash functions.
1919-
1920-
\subsection{Hash functions}
1921-
\label{sec:hashfunc}
1922-
1923-
Calculating and checking the hashes of things is a common operation.
1924-
Here is a demonstration of how to calculate a sha256 hash within a kernel module.
1925-
To provide the sha256 algorithm support, make sure \cpp|CONFIG_CRYPTO_SHA256| is enabled in kernel.
1926-
1927-
\samplec{examples/cryptosha256.c}
1928-
1929-
Install the module:
1930-
1931-
\begin{codebash}
1932-
sudo insmod cryptosha256.ko
1933-
sudo dmesg
1934-
\end{codebash}
1935-
1936-
And you should see that the hash was calculated for the test string.
1937-
1938-
Finally, remove the test module:
1939-
1940-
\begin{codebash}
1941-
sudo rmmod cryptosha256
1942-
\end{codebash}
1943-
1944-
\subsection{Symmetric key encryption}
1945-
\label{sec:org2fab20b}
1946-
Here is an example of symmetrically encrypting a string using the AES algorithm and a password.
1947-
1948-
\samplec{examples/cryptosk.c}
1949-
19501913
\section{Virtual Input Device Driver}
19511914
\label{sec:vinput}
19521915
The input device driver is a module that provides a way to communicate with the interaction device via the event.

0 commit comments

Comments
 (0)