https://medium.com/mattr-global/jwt-vs-linked-data-proofs-comparing-vc-assertion-formats-a2a4e6671d57
JSON-LD vs. JWT web search result
https://jwt.io/
JSON Web Tokens
Sunday, August 23, 2020
looking at different expressions of Verifiable C
Saturday, August 22, 2020
catagory theory notes
https://www.youtube.com/watch?v=Tz3B21zuMSw
[He explains things well]
And...this video and Marko led me to buy this book
Tuesday, August 18, 2020
Antenna thoughts.
Build a quarter wave ground plane antenna with a turnstile antenna as a reflector? Try to receive in the VHF band.
See this video:
How to Build: Ham Radio 2 Meter Quarter Wave Antenna - K7AGE -- Apr 9, 2014 https://www.youtube.com/watch?v=HkmD3Sgz7Q0
Also see:
https://en.wikipedia.org/wiki/Turnstile_antenna
Just the bottom half of this, the top half will be the quarter wave antenna.
(https://en.wikipedia.org/wiki/Antenna_types#/media/File:SatelliteAntenna-137MHz_closeup.jpg)
How do I know the spacing between the quarter wave antenna at the top, and wave antenna at the bottom?
Use an RTL-SDR. Use welding rod as wire.
https://en.wikipedia.org/wiki/Reflector_(antenna)
For now, don't worry about this:
https://github.com/Blockstream/satellite
(it requires different hardware it seems)
If you want to do LoRa uplink/downlink try FoSSaSat.
#302 We build a 20 Dollars LoRa Satellite Ground Station and we follow the FossaSat-1 launch
https://www.youtube.com/watch?v=5k0aM-PJzo8
or Lacuna Space
https://www.youtube.com/watch?v=n911zTNIn8E
#305 Transfer a LoRa message through space to my PC before 2020?
It looks like you would want to stick with the {Quarter Wave}/{Ground Plane Antenna} as it might be easier to find satellites (rather than one or just a few!)
More:
https://amsat-uk.org/satellites/frequencies-of-active-satellites/
https://www.rtl-sdr.com/category/satellite/
https://www.rtl-sdr.com/rtl-sdr-tutorial-receiving-noaa-weather-satellite-images/
https://w5nor.org/antennas/
(so you can get an idea about parts and sizing)
Wednesday, July 15, 2020
Bringing Together the Last 3 Cryptography Posts
An example public key is:
uint8_t publicKey[64] = {
0xF9, 0xC3, 0x6F, 0x89, 0x64, 0x62, 0x33, 0x78, 0xBD, 0xC0, 0x68, 0xD4, 0xBC, 0xE0, 0x7E, 0xD1,
0x7C, 0x8F, 0xA4, 0x86, 0xF9, 0xAC, 0x0C, 0x26, 0x13, 0xCA, 0x3C, 0x8C, 0x30, 0x6D, 0x7B, 0xB6,
0x1C, 0xD3, 0x67, 0x17, 0xB8, 0xAC, 0x5E, 0x4F, 0xEA, 0x8A, 0xD2, 0x3D, 0xC8, 0xD0, 0x78, 0x3C,
0x23, 0x18, 0xEE, 0x4A, 0xD7, 0xA8, 0x0D, 0xB6, 0xE0, 0x02, 0x6A, 0xD0, 0xB0, 0x72, 0xA2, 0x4F
};
When working with a few cryptography libraries both 3rd party, and those produced by the manufacturer of the ATECC508A, MicroChipTech, I discovered a library called CryptoAuthTools.
In a file called ecdh.py in the CryptoAuthTools library [3], I found out about the structure of the data:
# Convert device public key to a cryptography public key object
device_pub = ec.EllipticCurvePublicNumbers(
curve=ec.SECP256R1(),
x=int_from_bytes(device_pub[0:32], byteorder='big'),
y=int_from_bytes(device_pub[32:64], byteorder='big'),
).public_key(default_backend())
The public key is a point. From the literature, I infer this is the uncompressed form. In Practical Cryptography for Developers, “The public keys in the ECC are EC points - pairs of integer coordinates {x, y}, laying on the curve.
An ECDSA key-pair consists of a private key which is an integer and a public key which is an elliptic curve point [7].
“public key: A coordinate that corresponds to a private key, but does not need to be kept secret.
More information about ECC, including graphical explanations, can be found at [10].
I would like to do two things. One is to import the public key from the crpyto chip into a library hosted on my laptop. Two is to import the signed message and original message and verify it with the public key. I believe that a bridge to the answer to this starts with examining the "ECDSA Sign" and "ECDSA Verify Signature" sections in [7]
Early attempts at importing the public key with fastecdsa were unsuccessful. The points were not on the curve.
See:
https://gist.github.com/bshambaugh/6f0fe5a63f96b0e0a95b404cc103e9c4
Okay, it works now:
https://forum.sparkfun.com/viewtopic.php?f=102&t=53408&p=217284#p217284
The message and the signed message are as follows:
uint8_t message[32] = {
0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F,
0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F
};
uint8_t signature[64] = {
0xD1, 0x84, 0x7E, 0x48, 0xD1, 0x40, 0x52, 0x87, 0xFF, 0x97, 0x49, 0x65, 0x66, 0x7D, 0x57, 0xE7,
0xF4, 0x38, 0xF2, 0x02, 0xA9, 0x8C, 0x9D, 0x17, 0x27, 0x5C, 0x59, 0x92, 0x2D, 0x12, 0x2B, 0xE7,
0xF9, 0x0D, 0x7A, 0x68, 0xB1, 0x6A, 0xB0, 0x5D, 0x47, 0x2C, 0x59, 0x1A, 0xDF, 0xC3, 0xCA, 0x77,
0x20, 0x4E, 0xC6, 0xAB, 0x8A, 0xC7, 0x99, 0x53, 0xE5, 0x14, 0xD2, 0x82, 0x04, 0x4F, 0x50, 0xB9
};
[0] http://ww1.microchip.com/downloads/en/DeviceDoc/20005928A.pdf
[2] https://cryptii.com/pipes/base64-to-hex
[4] http://koclab.cs.ucsb.edu/teaching/ecc/project/2015Projects/Bjoernsen.pdf
Tuesday, July 14, 2020
scratch work for cryptography 3
An example public key is:
uint8_t publicKey[64] = {
0xF9, 0xC3, 0x6F, 0x89, 0x64, 0x62, 0x33, 0x78, 0xBD, 0xC0, 0x68, 0xD4, 0xBC, 0xE0, 0x7E, 0xD1,
0x7C, 0x8F, 0xA4, 0x86, 0xF9, 0xAC, 0x0C, 0x26, 0x13, 0xCA, 0x3C, 0x8C, 0x30, 0x6D, 0x7B, 0xB6,
0x1C, 0xD3, 0x67, 0x17, 0xB8, 0xAC, 0x5E, 0x4F, 0xEA, 0x8A, 0xD2, 0x3D, 0xC8, 0xD0, 0x78, 0x3C,
0x23, 0x18, 0xEE, 0x4A, 0xD7, 0xA8, 0x0D, 0xB6, 0xE0, 0x02, 0x6A, 0xD0, 0xB0, 0x72, 0xA2, 0x4F
};
When working with a few cryptography libraries both 3rd party and those produced by the manufacturer I discovered a library called CryptoAuthTools.
In a filed called ecdh.py in the CryptoAuthTools library I found out about the structure of the data.
# Convert device public key to a cryptography public key object
device_pub = ec.EllipticCurvePublicNumbers(
curve=ec.SECP256R1(),
x=int_from_bytes(device_pub[0:32], byteorder='big'),
y=int_from_bytes(device_pub[32:64], byteorder='big'),
).public_key(default_backend())
https://github.com/MicrochipTech/cryptoauthtools/blob/master/python/examples/ecdh.py#L101-L105
I noticed that the first 32 (or 33 bytes?) represented the x par of the key and the last 32 (or 31 bytes?) represented the y part of the key.
It is a curve over a prime field with:
Order n =
115792089210356248762697446949407573530086143415290314195533631308867097853951
and generator points
G x = 6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296
and
G y = 4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5
but really the generator points can be anything as long as they are of order n.
These bytes are in the P-256 curve referenced in the ATECC508A data sheet and described mathematically in the Digital Signature Standard.
https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.186-4.pdf
(1)https://www.sparkfun.com/products/15573(2) https://cryptii.com/pipes/base64-to-hex
Other key [it looks like R34-35 and ecc608a] -- R34-35 uses a CryptoChip.
https://www.mouser.com/datasheet/2/268/SAMR34-R35-Low-Power-LoRa-Sub-GHz-SiP-Data-Sheet-D-1507280.pdf
https://github.com/MicrochipTech/atsamr34_ecc608a_actility
https://www.microchip.com/Developmenttools/ProductDetails/DM320111
Wednesday, July 8, 2020
Adding more cryptography links
https://livebook.manning.com/book/real-world-cryptography/welcome/v-7/
https://www.cryptologie.net/article/474/bits-and-bytes-ordering-in-5-minutes/
https://docs.oracle.com/cd/E19253-01/817-6223/chp-typeopexpr-2/index.html
https://docs.python.org/3.2/library/stdtypes.html
https://en.wikipedia.org/wiki/Integer_(computer_science)
https://www.programiz.com/python-programming/methods/built-in/int
https://cryptii.com/pipes/base64-to-hex
https://docs.python.org/2/library/binascii.html
https://www.wikihow.com/Convert-Binary-to-Hexadecimal
https://github.com/MicrochipTech/cryptoauthtools/blob/master/python/examples/ecdh.py
https://github.com/AntonKueltz/fastecdsa/blob/e8a25d75f5f7018f703844b17357d0c7a9a0b4be/fastecdsa/encoding/sec1.py
https://fastecdsa.readthedocs.io/en/latest/fastecdsa.html
https://letsencrypt.org/docs/a-warm-welcome-to-asn1-and-der/
Edit: Here is a presentation with pictures of an elliptic curve:
https://speakerdeck.com/mrinalwadhwa/just-enough-math-to-understand-elliptic-curve-cryptography
Edit: Here is another book that shows construction of a public key:
https://wizardforcel.gitbooks.io/practical-cryptography-for-developers-book/asymmetric-key-ciphers/elliptic-curve-cryptography-ecc.html
Sunday, June 28, 2020
I glanced at the mm-ADT docs and started searching
(Phil Trelford - Write your own compiler in 24 hours - Bristech Conference 2015)
https://www.youtube.com/watch?v=OjaAToVkoTw
(How to build a virtual machine)
https://www.youtube.com/watch?v=eF9qWbuQLuw
(Parser and Lexer — How to Create a Compiler part 1/5 — Converting text into an Abstract Syntax Tree)
In the Science of Functional Programming, section on AST.
Here are the mm-ADT docs:
https://www.mm-adt.org/vm/
Edit::
https://www.meetup.com/Category-Theory/events/vmkkjrybckbkb/
(a presentation about mm-ADT is here.)
