%%% Preamble \documentclass[11pt, a4paper]{article} \usepackage[english]{babel} % English language/hyphenation \usepackage{url} \usepackage{tabularx} \usepackage{pdfpages} \usepackage{float} \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*{5} \subsection*{5.1} The hash function is collision resistante for $n=1$, since if the block size is one the hash function is the encryption. Therefore: if the message is only one block long: $$H=E$$ $$m\ne m'$$ $$H(m)=E(K, IV \oplus m) = C_1$$ $$H(m')=E(K, IV \oplus m') = C_2$$ And if there the hashing function was not collision resistant that would imply $$C_1=C_2\Rightarrow D(C_1)=D(C_2) \Rightarrow m=m'$$ and since $m\ne m'$ the hash function is collision resistant, for messages with 1 block. For if the block size is bigger than one we can say $$H(m)=E(m)_{\text{Last Block}}$$ $$E(m)=E(K, m)$$ $$\exists a,b,c,d : m = a||b \and m' = c||d$$ where a,b,c,d are the size of one block $$H(m)=E(b \oplus E(a \oplus IV)) = C_1$$ $$H(m')=E(d \oplus E(c \oplus IV)) = C_2$$ since it's possible to have: $$b \oplus E(a \oplus IV) = d \oplus E(c \oplus IV)$$ with: $$a \ne b \ne c \ne d$$ therefore $$H(m)=H(m') \and m\ne m'$$ \end{document}