HTTP e REST

HTTP is the acronym for HyperText Transfer Protocol. Caratteristiche principali (3) Comunicazioni fra client e server, e quanto sono comunicate le cose si chiude la connessione e ci sono politiche di caching molto bone (tipo con i proxy) Generico: perché è un protocollo utilizzato per caricare moltissime tipologie di risorse! Stateless, ossia non vengono mantenute informazioni su scambi vecchi, in un certo modo ne abbiamo parlato in Sicurezza delle reti quando abbiamo parlato di firewall stateless. Solitamente possiamo intendere questo protocollo come utile per scambiare risorse di cui abbiamo parlato in Uniform Resource Identifier. ...

December 6, 2024 · Reading Time: 6 minutes ·  By Xuanqiang Angelo Huang

Fast Fourier Transforms

The algorithm has been the same, some ideas are in Fourier Series, but architectures change, which means there are new ways to make this algorithm even faster. Example of transforms We have learned in Algebra lineare numerica, Cambio di Base that linear transforms are usually a change of basis. They are matrix vector multiplications (additions and multiplications by constants). The optimizations are based on what sorts of transforms we have (e.g. Sparse Matrix Vector Multiplication, or dense versions). The same idea applies also for Fourier transforms. ...

April 7, 2025 · Reading Time: 5 minutes ·  By Xuanqiang Angelo Huang

Compiler Limitations

On Compiler Adding compilation flags to gcc not always makes it faster, it just enables a specific set of optimization methods. It’s also good to turn on platform specific flags to turn on some specific optimization methods to that architecture. Remember that compilers are conservative, meaning they do not apply that optimization if they think it does not always apply. What are they good at Compilers are good at: mapping program to machine ▪ register allocation ▪ instruction scheduling ▪ dead code elimination ▪ eliminating minor inefficiencies ...

March 3, 2025 · Reading Time: 3 minutes ·  By Xuanqiang Angelo Huang

Diffusion Models

Diffusion is a physical process that models random motion, first analyzed by Brown when studying pollen grains in water. In this section, we will first analyze a simplified 1-dimensional version, and then delve into diffusion models for images, the ones closest to (Ho et al. 2020). The Diffusion Process This note follows original Einstein’s presentation, here we have a simplified version. Let’s suppose we have a particle at $t = 0$ at some position $i$. We have a probability of jumping to the left of $p$ to right of $q$, the rest is staying at the same position. ...

January 5, 2025 · Reading Time: 13 minutes ·  By Xuanqiang Angelo Huang

Sicurezza OS

Possiamo classificare tre aree generali quando si parla di sicurezza informatica: Hardware Software human-ware. Non tratteremo in particolare esattamente come ogni campo viene declinato, però possiamo Una altra tendenza generale è che più è complessa più è insicura. e questo senso di insicurezza cresce in modo maggiore rispetto al lineare. Security principles Open Design perché così può essere scrutata da più persone Economy of mechanism spiegata sotto. Fail-safe defaults questo molto importante perché molti sistemi hanno dei default che possono essere exploitati. Complete mediation: così abbiamo qualcosa che tracka tutti gli accessi, che controlla gli accessi. Least privilege questo va a braccetto con il fail-safe. Privilege separation così possiamo mettere in modo indipendente un privilegio per qualcos’altro. CIA properties Ne abbiamo parlato in modo leggermente inverso in Sicurezza delle reti e in Notions of Security. In questo caso sono ...

May 30, 2024 · Reading Time: 6 minutes ·  By Xuanqiang Angelo Huang

Wireless attack vectors

In this note we will talk about some common ways to attack wireless based devices. Attacking an automated door Usually these doors are opened by radio frequency keys, and can be opened easily (e.g. replay attacks, Jam the frequency) Jamming This is the easiest way to attack. Just send many signals to make a certain frequency un-usable in our space. But with Frequency hopping this attack is solved. See Tecnologia Wireless#Frequency Hopping But this method could be easily known and observed (enables eavesdropping, against confidentiality, a principle in Notions of Security#CIAA principles of security.) if the initial seed is known. ...

June 2, 2024 · Reading Time: 5 minutes ·  By Xuanqiang Angelo Huang

TLS-SSL protocol

First time we talked about this was in Sicurezza delle reti#Protocollo SSL But that was a simple toy model. Secure Socket Layer Secure socket Layer and TLS add security (see security principles in Notions of Security) on the transport layers, whereas IPSec protocol adds it to the network level. So this works on a higher level of abstraction following the ISO OSI framework Architettura e livelli 1, 2#Livelli ISO/OSI. SSL is the old version of the TLS protocol. This provides integrity and confidentiality to the communication, see Notions of Security. The main difference of SSL and TLS is that this has vulnerabilities like POODLE attack ...

June 1, 2024 · Reading Time: 4 minutes ·  By Xuanqiang Angelo Huang

IPSec protocol

Questo è un protocollo di sicurezza a livello Rete e non più a livello socket! Perché vorremmo avere sicurezza a questo livello? È una cosa troppo comune da dover mettere a livello superiore (ma solitamente viene messa a questo livello per la sicurezza, quindi non è implementata ovunque per dire), quindi IPsec vuole facilitare l’implementazione dei principi CIA a un livello più basso, in modo che sia flessibile e customization. ...

May 28, 2024 · Reading Time: 6 minutes ·  By Xuanqiang Angelo Huang

Sicurezza delle reti

Obiettivi della sicurezza (!!!) Vogliamo creare delle reti che abbiamo certe garanzie di sicurezza, soprattutto: Confidenzialità, non vorremmo che il nostro messaggio sia intercettabile e leggibili da persone intermedie Integrità: non vogliamo che messaggi possano essere cambiati senza intervento del sender Autenticazione: vorremmo sapere con chi stiamo parlando, e vorremmo essere sicuri che non stiano mentendo sull’identità. Sicurezza operativa(Availability): vorremmo essere in grado di poter continuare a fornire il servizio (quindi non sia possibile dossare, o installare malware che modifichino il comportamento del servizio). Questi sono stati trattati un po’ in Notions of Security. ...

April 30, 2024 · Reading Time: 10 minutes ·  By Xuanqiang Angelo Huang

Bag of words

Bag of words only takes into account the count of the words inside a document, ignoring all the syntax and boundaries. This method is very common for email classifications techniques. We can say bag of words can be some sort of pooling, it’s similar to the computer vision analogue. It’s difficult to say what is the best method (also a reason why people say NLP is difficult to teach). Introduction to bag of words Faremo una introduzione di applicazione di Naïve Bayes applicato alla classificazione di documenti. ...

Reading Time: 2 minutes ·  By Xuanqiang Angelo Huang