add second cw
Some checks reported errors
continuous-integration/drone/push Build encountered an error

This commit is contained in:
Andre Henriques 2023-12-01 17:55:41 +00:00
parent d21224ac4c
commit 39a6fbde61
5 changed files with 284 additions and 55 deletions

View File

@ -8,59 +8,69 @@ steps:
commands: commands:
- bash linting.sh - bash linting.sh
# - name: Build UPDS-1 - name: Build Cw1
# commands: commands:
# - cd cw - cd firstcw/cw
# - pdflatex cw.tex - pdflatex cw.tex
# # Prepare bib # Prepare bib
# - /usr/bin/vendor_perl/biber cw - /usr/bin/vendor_perl/biber cw
# # Compile twice for the table of contents and for bib text # Compile twice for the table of contents and for bib text
# - pdflatex cw.tex - pdflatex cw.tex
# - pdflatex cw.tex - pdflatex cw.tex
# - cd - - cd -
# # - name: Build Report - name: Build Cw2
# # commands: commands:
# # - cd report - cd secondcw/cw
# # - cp ../upds-1/UPDS-content.tex UPDS-1-content.tex - pdflatex cw.tex
# # - cp ../upds-2/UPDS-content.tex UPDS-2-content.tex # Prepare bib
# # - pdflatex report.tex - /usr/bin/vendor_perl/biber cw
# # # Prepare bib # Compile twice for the table of contents and for bib text
# # - /usr/bin/vendor_perl/biber report - pdflatex cw.tex
# # # Compile twice for the table of contents and for bib text - pdflatex cw.tex
# # - pdflatex report.tex - cd -
# # - cd -
# #
# # - name: Generate text
# # commands:
# # - pnpm i
# # - pnpm ts-node main.ts report/report.tex
# - name: gitea_release # - name: Build Report
# environment: # commands:
# TOKEN: # - cd report
# from_secret: token # - cp ../upds-1/UPDS-content.tex UPDS-1-content.tex
# commands: # - cp ../upds-2/UPDS-content.tex UPDS-2-content.tex
# - tea login add --url https://git.andr3h3nriqu3s.com --token "$TOKEN" # - pdflatex report.tex
# - tea r rm -y current || echo "Release not found" # # Prepare bib
# # - tea r c --title "Latest Report" --asset report/report.pdf --asset upds-1/UPDS12-1.pdf --asset upds-2/UPDS12-2.pdf --asset results.txt --asset poster/poster.pdf current # - /usr/bin/vendor_perl/biber report
# - tea r c --title "1st cw work" --asset cw/cw.pdf first-cw-work # # Compile twice for the table of contents and for bib text
# - pdflatex report.tex
# - cd -
#
# - name: Generate text
# commands:
# - pnpm i
# - pnpm ts-node main.ts report/report.tex
# - name: Remove current on failure - name: gitea_release
# environment: environment:
# TOKEN: TOKEN:
# from_secret: token from_secret: token
# commands: commands:
# - tea login add --url https://git.andr3h3nriqu3s.com --token "$TOKEN" - tea login add --url https://git.andr3h3nriqu3s.com --token "$TOKEN"
# - tea r rm -y current || echo "Release not found" - tea r rm -y current || echo "Release not found"
# trigger: - tea r c --title "Latest" --asset firstcw/cw/cw.pdf --asset secondcw/cw/cw.pdf latest
# status:
# - failure
# when:
# status:
# - failure
#- name: latest - name: Remove current on failure
environment:
TOKEN:
from_secret: token
commands:
- tea login add --url https://git.andr3h3nriqu3s.com --token "$TOKEN"
- tea r rm -y current || echo "Release not found"
trigger:
status:
- failure
when:
status:
- failure
# - name: latest
# environment: # environment:
# TOKEN: # TOKEN:
# from_secret: token # from_secret: token

View File

@ -0,0 +1,74 @@
/*
* Coursework 2 PI protocol
*/
usertype Timestamp;
usertype Sessionkey;
hashfunction Mac;
protocol protocolPI(Network, Application, Phone) {
/* Role R - Phone
*
* has keys k(N,R)
*
*/
role Phone {
var SesK: SessionKey;
var tl: Timestamp;
recv_keysPhone(Network, Phone, Mac({SesK, tl}k(Network, Phone)), {SesK, tl}k(Network, Phone));
var mApp: Nonce;
recv_1(Application,Phone, {mApp}k(SesK));
fresh mPhone: Nonce;
send_2(Phone,Application, {mApp, mPhone}k(SesK));
}
/* Role S - Application
*
* has keys k(N,S)
*
*/
role Application {
send_refreshKeys(Application,Network, Application, Phone);
var SesK: SessionKey;
var tl: Timestamp;
recv_keysApp(Network,Application, Mac({SesK, tl}k(Network, Application)), {SesK, tl}k(Network, Application));
fresh mApp: Nonce;
var mPhone: Nonce;
send_1(Application,Phone, {mApp}k(SesK));
recv_2(Phone,Application, {mApp, mPhone}k(SesK));
}
/* Role N - Network
*
* has keys k(N,R) and k(N,S)
*
*/
role Network {
recv_refreshKeys(Application,Network, Application, Phone);
fresh SesK: SessionKey;
fresh tl: Timestamp;
send_keysApp(Network,Application, Mac({SesK, tl}k(Network, Application)), {SesK, tl}k(Network, Application));
send_keysPhone(Network,Phone, Mac({SesK, tl}k(Network, Phone)), {SesK, tl}k(Network, Phone));
}
}

69
secondcw/cw/cw.tex Normal file
View File

@ -0,0 +1,69 @@
%%% Preamble
\documentclass[11pt, a4paper]{article}
\usepackage[english]{babel} % English language/hyphenation
\usepackage{url}
\usepackage{tabularx}
\usepackage{pdfpages}
\usepackage{float}
\usepackage{amsmath, amssymb}
\usepackage{systeme}
\usepackage{graphicx}
\graphicspath{ {../images for report/} }
\usepackage[margin=2cm]{geometry}
\usepackage{hyperref}
\hypersetup{
colorlinks,
citecolor=black,
filecolor=black,
linkcolor=black,
urlcolor=black
}
\usepackage{cleveref}
%%% Custom headers/footers (fancyhdr package)
\usepackage{fancyhdr}
\pagestyle{fancyplain}
\fancyhead{} % No page header
\fancyfoot[L]{} % Empty
\fancyfoot[C]{\thepage} % Pagenumbering
\fancyfoot[R]{} % Empty
\renewcommand{\headrulewidth}{0pt} % Remove header underlines
\renewcommand{\footrulewidth}{0pt} % Remove footer underlines
\setlength{\headheight}{13.6pt}
% numeric
\usepackage[style=ieee,sorting=none,backend=biber]{biblatex}
\addbibresource{../main.bib}
% Write the approved title of your dissertation
\title{Automated image classification with expandable models}
% Write your full name, as in University records
\author{Andre Henriques, 6644818}
\date{}
%%% Begin document
\begin{document}
\section*{1}
\subsection*{1.1}
The file ag01598_6644818_1.1.spdl contains the base model of protocol$\PI$.
I choose the names of the roles based on their functions since it would make the file more readable so R is Phone, S is Application, N is Network.
As the diagram shows the first message is sent from the phone do the network to request the generation of a new session key.
The keys where modeled using a custom usertype called ''SessionKey" and the time to live has modeled using a custom usertype called "Timestamp"
The Network then aswers to the Phone and the Application the keys and the time to live and the hashed value of that using a hash function named ''Mac".
The Phone and the Application verify the Mac and then the phone sends a nonce to the phone and the phone answers back with a new nonce and the original nonce.
\end{document}

68
secondcw/lab9.spdl Normal file
View File

@ -0,0 +1,68 @@
/*usertype Timestamp;
protocol LaTe(C, S)
{
role C {
fresh nc: Nonce;
var ts: Timestamp;
send_1(C,S, C, nc);
recv_2(S,C, nc, ts, {nc, ts}k(S, C));
claim_C1(C,Nisynch);
claim_C2(C,Niagree);
claim_C3(C,Alive);
claim_C4(C,Weakagree);
claim_C5(C, Commit, S, nc, ts);
}
role S {
var nc: Nonce;
fresh ts: Timestamp;
//send_!timestampSet(S,S, ts);
recv_1(C,S, C, nc);
claim_C5(S, Running, C, nc, ts);
send_2(S,C, nc, ts, {nc, ts}k(S, C));
claim_S1(S,Nisynch);
claim_S2(S,Niagree);
claim_S3(S,Alive);
claim_S4(S,Weakagree);
}
}*/
usertype TimeStamp;
hashfunction H1;
protocol LATe(I,R)
{
role I # Time Client - Initiator
{
fresh Na : Nonce;
var T : TimeStamp;
send_1(I,R,I,Na);
recv_2(R,I,Na,T,H1({Na,T}k(I,R)));#encrypt-then-hash
claim_I1(I,Nisynch); #encrypt-then-hash
claim_I2(I,Niagree);
claim_I3(I,Alive);
claim_I4(I,Weakagree);
claim_I5(I, Commit, R, Na, T);
}
role R # Time Server - Responder
{
var Na : Nonce;
fresh T : TimeStamp;
recv_1(I,R,I,Na);
claim_C5(R, Running, I, Na, T);
send_2(R,I,Na,T,H1({Na,T}k(I,R)));#encrypt-then-hash
}
}

8
secondcw/main.bib Normal file
View File

@ -0,0 +1,8 @@
@misc{cadonfs,
author={The CADO-NFS Development Team},
title={{CADO-NFS}, An Implementation of the Number Field Sieve
Algorithm},
note={Release 2.3.0},
year={2017},
url={http://cado-nfs.inria.fr/}
}