-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnotes.txt
95 lines (68 loc) · 3.46 KB
/
notes.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
------ AB INITIO FOR ANYTHIN -------
cargo new projectname
git init
git add .
git commit -m 'to change branch name'
git branch -m main
git push
git remote add origin https://github.com/PrisionMike/mypki.git
git push -u origin main
--------------xxxxxxx--------------
------ PROJECT NOTES -----------------
1. Generate a key pair using openssl
a. openssl genrsa -out private.pem 2048
2. Draw the public key from the private one.
openssl rsa -in private.pem -out public.pem -outform PEM -pubout
3. Encrypting a file:
openssl rsautl -encrypt -inkey public.pem -pubin -in file.txt -out file.ssl
4. openssl rsautl -decrypt -inkey private.pem -in file.ssl decrypted.txt
2. The "key pair" generated above is what is per standards, called
as "private key". It has the public key parts as well as some
preperformed computations to speed up decryption (using something
called a "Chinese Remainder Theorem")
3. The 'keys' are number pairs. Here in too. (n,e) is the public
key; (n,d) is the private key.
4. e is for some reason not randomised. It is often a specific well
known constant (65537) or is often among a few well known constants.
5. So the modus operandi is to command a 'private key' (has pub key
info within it too) then draw out the public key from it and publish it.
Openstack is the open source alternative to proprietary cloud stacks.
You can install it on your system and it will provide you a proper cloud stack
like Azure where you can run lots of services on it.
It runs on a base OS and a virtualization system. KVM is the default virtualization
it supports.
KVM is Linux's virtualization support. It turns the Linux kernel itself
into a hypervisor. It is sort of in the middle of the 2 types of virtualization.
Technically it's II but it works like a I.
Also given the primary use case may be systems like Bitcoin where you don't
have to be responsible to even claim to know the key holder, your focus
should not even be on the 'server' side on things.
FOCUS ON SIGNING. We're trying to build ledgers here. Just focus on signing.
Not even verification.
As per the plan I was supposed to work on file sharing using Rust now,
so that's what I am gonna do.
SFTP and FTPS are secure file transfer methods but I am gonna go with
simple HTTPS to send files around.
Now let's create an effin file named JSI.txt and our immediate target would be to sign it.
20X TO 30X speed improvement when running in release mode.
CURRENT MISSION: The program should generate a key pair (unencoded in any format)
and save the pubkey and pvkey in separate directories.
OR
It will become a lib which will return the pub key and save the pv key
in a stated directory. Unsecured. Unencrypted.
So I am disabling (or uninstalling) the official Rust extension in favour of the
unofficial but official rust-analyzer. That is supposed to be better supported
and is in more active development than the off which may as wel be dead.
2048 bit random 'Int' generation time: 17us (debug). 0.6us (release)
Threading out an RNG: 1124us (debug). 500us (release)
It takes about... [RELEASE MODE] | [DEBUG MODE]
160µs | 1.7ms to run the primitive primality test,
14ms | 600ms for the Fermat Little test,
221ms | 8.7s for the Miller Rabbin test [16 ROUNDS]
Flagses is going to be an 8 bit control word
which will contain all the commands encoded
in the 8 bit word.
0 = No Optimisation. No Telemetry
1 = No Optimisation. Telemetry.
2 = Optimisation. No Telemetry.
3 = Optimisation. Telemetry.