Graham Sutherland / Polynomial
Contacting Graham Sutherland / Polynomial
Federation handle:
@gsuberland@chaos.social
Graham Sutherland / Polynomial's Information
Graham Sutherland / Polynomial's Bio
he\him
Into electronics, windows internals, cryptography, security, compute hardware, physics, colourimetry, lasers, stage lighting, D&B, DJing, demoscene, socialism.
Currently looking for infosec work. See pinned post for details.
I am mothman.
Heavily ADHD.
Nullsector/laser team @ EMF Camp, lasers & lighting orga @ NOVA Demoparty.
I sell funny warning stickers at Unsafe Warnings: https://unsafewarnings.etsy.com
All posts encrypted with ROT256-ECB.
Header photo by @jtruk
Graham Sutherland / Polynomial's Posts
Graham Sutherland / Polynomial has 475 posts.
Graham Sutherland / Polynomial
I'm up to 9 pages of notes on Galois field maths and the construction and properties of AES, based on Christof Paar's lectures.
Likes: 0
Replies: 0
Boosts: 0
Graham Sutherland / Polynomial
it's been forever since I made hand written notes. my knuckles hurt (arthritic joint condition and being left handed kinda sucks lol) but I'm quite happy with these.
Likes: 0
Replies: 0
Boosts: 0
Graham Sutherland / Polynomial
@r they had been teaching it very much as "it's how you determine the slope of the graph" without any applied context and I just couldn't fathom why you would want to know what the gradient was on a graph at a particular x coordinate, let alone why you'd want to find the coordinate where a particular gradient was found, especially given how involved and unintuitive the procedures to do so could be. naturally once I could map it to a physics context it was trivial to understand why the use-case.
Likes: 0
Replies: 0
Boosts: 0
Graham Sutherland / Polynomial
@r I'm also a visual learner. I can't do abstract concepts; I need a concrete example and application. I spent the first 75% of calculus at school being unable to grok it at all, blindly following rules and procedures by rote, until my physics teacher happened to put the equations of motion on the board in a certain order and suddenly it clicked that they were derivatives of one another, and that calculus was about modelling dependent behaviours like rates of change, and then I understood fine.
Likes: 0
Replies: 0
Boosts: 0
Graham Sutherland / Polynomial
@r part of the problem I've found is that most of the lectures on the subject are being delivered to students who have been studying number theory and related topics as part of a dedicated mathematics module, so there's an expectation of comfort and recent familiarity with the underlying mathematical concepts, which I lack. I couldn't have really told you what a group, ring, or field was before the lecture, for example. my algebra is mostly only exercised for electronics.
Likes: 0
Replies: 0
Boosts: 0
Graham Sutherland / Polynomial
re: spoiler/help
@r because I haven't done polynomial division in years and can't remember the procedure at all. I think I had maybe two hours worth of tutoring on it back in 2005 or 2006. I remember being taught trial division at some point for factorisation, so that's the mental model I applied to understanding the approach here. wasn't until I had some time to percolate on it that I realised there was a rigorous procedure being followed rather than trialling based on elimination convenience.
Likes: 0
Replies: 0
Boosts: 0
Graham Sutherland / Polynomial
@r the direct focus on the procedure and minimal formalism with no expectations of knowing much beyond simple algebra (e.g. explaining the definitions of group, ring, field in basic terms) is the key here. any less focus on the implementation and examples would have been insufficient here; it's really not an accessible topic otherwise.
Likes: 0
Replies: 0
Boosts: 0
Graham Sutherland / Polynomial
spoiler/help
the reason xor is used here is because addition, subtraction, and xor are all the same operation in GF(2), so the c^=p' line does the addition step he showed in the example.
I'm not 100% sure the above is correct for all cases, but it does at least follow the same approach - sh represents the index you raise x to for each trial division step, so if you have x^4 as your highest index term in C' and x^3 as your highest index term in P, then you're going to trial divide by x^1, i.e. x.
Likes: 0
Replies: 0
Boosts: 0
Graham Sutherland / Polynomial
spoiler/help
I think if you do the polynomial product A(x)∙B(x) to get C'(x), then interpret the coefficients of C'(x) and P(x) as bit vectors, you can do the modulo reduction as follows:
```
c = c'
while c >= 2^3:
sh = msb(c)-msb(p)
p' = p<<sh
c ^= p'
```
where msb() returns the index of the MSB.
so in his example of C'(x)=x^4+x^3+x+1 and P(x)=x^3+x+1, the steps are:
p=1011 (x^3+x+1)
c'=11011 (x^4+x^3+x+1)
c=11011
c>=2^3
sh=1
p'=10110
c=1101
c>=2^3
sh=0
p'=1011
c=110
c<2^3
thus, c=x^2+x
Likes: 0
Replies: 0
Boosts: 0
Graham Sutherland / Polynomial
spoiler/help
the trickiest part for me was the polynomial reduction at the end.
if you get stuck there too: since the coeffs are mod 2 you just cancel out matching terms. he first trialled x as the divisor, getting us P*x so that the x^3 term in P would become x^4 and cancel out the x^4 term in C'. the result of this trial still had an x^3 term, so still not in GF(2^3), so he trialled x+1 as the divisor. he could test this by dividing the first trial result by P and that gave a result in GF(2^3)
spoiler/help
I think if you do the polynomial product A(x)∙B(x) to get C'(x), then interpret the coefficients of C'(x) and P(x) as bit vectors, you can do the modulo reduction as follows:
```
c = c'
while c >= 2^3:
sh = msb(c)-msb(p)
p' = p<<sh
c ^= p'
```
where msb() returns the index of the MSB.
so in his example of C'(x)=x^4+x^3+x+1 and P(x)=x^3+x+1, the steps are:
p=1011 (x^3+x+1)
c'=11011 (x^4+x^3+x+1)
c=11011
c>=2^3
sh=1
p'=10110
c=1101
c>=2^3
sh=0
p'=1011
c=110
c<2^3
thus, c=x^2+x
by Graham Sutherland / Polynomial ;
Likes: 0
Replies: 1
Boosts: 0
Graham Sutherland / Polynomial
just finished watching this lecture and holy crap I actually understand the fundamentals of Galois field arithmetic now, at least sufficiently for most cryptographic use. such a fantastic presentation that doesn't really expect any maths knowledge beyond fundamental algebra and integer modulo arithmetic.
if you choose to watch this, I highly recommend keeping a set of notes along the way - I found that it really aided my comprehension and retention of the details.
https://youtu.be/x1v2tX4_dkQ
Likes: 0
Replies: 0
Boosts: 1
Graham Sutherland / Polynomial
if I had to pick a single moment to highlight from 2024, it would be my first ever DJ set performed live in front of people instead of just streamed from home. talk about starting on a high point.
this incredible slow-mo shot from @jtruk, with major thanks to @yagfox, @solexious, and the rest of the EMF/nullsector folks for making it such a blast.
@gsuberland @jtruk @yagfox yaaas, so glad it got captured. Was a blast working with you as always, and so much fun actually getting to work the dancefloor together ❤️
by Charles Yarnold ;
Mentions: @solexious@chaos.social
Likes: 0
Replies: 1
Boosts: 0
Graham Sutherland / Polynomial
from what I can tell, the middleware bug is something to do with the contents of /dev changing during the execution of a cleanup script that runs periodically, which would explain why it's a rare edge-case.
looking through the logs it might've been a HBA hiccup because it did complain about something on /dev/da1, but it's hard to line up the timing because I don't exactly know when the script started.
I just found the actual answer to this. /etc/periodic/security/ has two periodic scripts that by default run daily: 100.chksetuid and 110.neggrpperm
by default (/etc/defaults/periodic.conf) these are enabled and configured to run daily. these scripts scan your system for files that have insecure setuid and negative group permissions, using `find`.
the problem is that this gets run *per jail* and if the jails mount large datasets it eats a ton of CPU time for several hours at a time.
by Graham Sutherland / Polynomial ;
Likes: 0
Replies: 1
Boosts: 0
Graham Sutherland / Polynomial
I do have a Grafana alert set up for "the CPU has been slammed solid for more than an hour", but it turns out the logic for it was broken so the alert never got sent.
going through my metrics, I can see that my average power consumption on the server rack was elevated by roughly 2kWh/day for the past two days, so this bug probably cost me about £1 in electricity.
from what I can tell, the middleware bug is something to do with the contents of /dev changing during the execution of a cleanup script that runs periodically, which would explain why it's a rare edge-case.
looking through the logs it might've been a HBA hiccup because it did complain about something on /dev/da1, but it's hard to line up the timing because I don't exactly know when the script started.
by Graham Sutherland / Polynomial ;
Likes: 0
Replies: 1
Boosts: 0
Graham Sutherland / Polynomial
had some mild panic last night when I thought my NAS had been popped by a cryptominer. it was acting strange, so I SSH'd in and found a bunch of Python processes slamming the CPU, all running as root, no jail associated. they were running code passed on the command line rather than a file, and the imports were threading related. killing them led them to come back.
in the end it turned out to be a middleware bug in TrueNAS. the code was getting stuck in a loop doing nothing.
I do have a Grafana alert set up for "the CPU has been slammed solid for more than an hour", but it turns out the logic for it was broken so the alert never got sent.
going through my metrics, I can see that my average power consumption on the server rack was elevated by roughly 2kWh/day for the past two days, so this bug probably cost me about £1 in electricity.
by Graham Sutherland / Polynomial ;
Likes: 0
Replies: 1
Boosts: 0