5_discussion.tex (19755B)
1 \chapter{Discussion} 2 \label{chap:disc} 3 This chapter analyses the \acl{CS} implementation and compares it to the existing implementation with \gls{RSABS}. 4 The comparison will include the schemes itself, performance comparisons and a discussion on the security assumptions. 5 For the performance comparison CPU usage, latency, bandwidth and storage space are compared. 6 7 \section{Cipher Agility} 8 One of the benefits of having another blind signature scheme in Taler is \textit{cipher agility}. 9 Cipher agility means that one scheme can substitute another, for example if one scheme gets compromised in the future. 10 11 Cipher agility is considered harmful in certain situations. 12 TLS 1.2 \cite{rfc5246} and IPSEC/IKEv2 \cite{rfc6071} are good examples on how dangerous cipher agility inside protocols can be. 13 There are many ways these protocols can be set up insecure. 14 \\\\ 15 Taler's protocols are built around blind signature schemes. 16 Therefore it is crucial to have an additional secure blind signature scheme that works with all Taler protocols. 17 As described in section \ref{sec:blind-sign-schemes}, blind signature schemes can vary and may be complex to substitute. 18 The \gls{CSBS} implementation provides such an alternative and thus \textit{cipher agility}. 19 20 \section{Scheme Comparison} 21 \label{chap:disc-scheme-comp} 22 Both schemes are explained in the preliminaries chapter (\gls{RSABS} in section \ref{fig:rsa-fdh-blind-sign} and \gls{CSBS} in \ref{fig:clause-blind-schnorr-sign-scheme}). 23 \\ 24 There are multiple differences worth mentioning. 25 The first difference is that Schnorr signatures are inherently randomized. 26 This is also where the additional step in Schnorr signatures comes from. 27 A random number is chosen by the signer for every signature. \\ 28 In \gls{CSBS} two blinding secrets are used instead of one in \gls{RSABS}. 29 On top of that, \gls{CSBS} needs to do most computations for signature creation twice, due to the \ac{ROS} problem (see \ref{par:ros-problem}). 30 \\\\ 31 \textit{\Gls{abort-idempotency}} is a very important property for Taler. 32 Ensuring \gls{abort-idempotency} with the \gls{CSBS} scheme is harder than it was with RSA, due to the many random elements in the scheme ($r_0, r_1, \alpha_0, \alpha_1, \beta_0, \beta_1, b$). 33 The reason that these values are chosen randomly is the need for \textit{unpredictability}.\\ 34 In the protocols (see chapter \ref{chap:design}) \gls{hkdf} is extensively used to derive these values instead of randomly generating them. 35 That way, the values are still \textit{unpredictable} (due to \gls{hkdf} properties), but now the protocols also ensure \textit{\gls{abort-idempotency}}. 36 In comparison to the RSA Blind Signature scheme, this is a clever and elegant solution, but the protocol complexity is increased. 37 \\\\ 38 One could now think that RSA would be much simpler to implement, since the scheme looks easier and more accessible for many. 39 This can go horribly wrong and many developers still underestimate implementing RSA. 40 There are a lot of attacks on RSA, some examples are listed on the famous tool RsaCtfTool \cite{ganapati:rsactftool}. 41 Ben Perez made a popular talk and blog post, about why one should stop using RSA and should preferably use libsodium and \ac{ECC} \cite{perez:stoprsa}. 42 Using \gls{RSABS} in Taler is still a reasonable and fine choice. 43 Taler uses libgcrypt, a well-known and tested library. 44 \\ 45 To conclude, the \gls{CSBS} protocols might be more complex to understand than the RSA Blind Signature protocols. 46 One has to keep in mind that implementing RSA correctly is hard. 47 \\ 48 Another difference worth mentioning is, that the \gls{CSBS} scheme does not need scheme specific configurations, whereas RSA needs a key size specified. 49 This is because the implemented \gls{CSBS} version only supports \gls{25519}. 50 \\\\ 51 Furthermore, both schemes provide \textit{perfect blindness}, see paragraph \ref{par:prop-blindness-rsa} for RSA and paragraph \ref{par:prop-blindness-cs} for \gls{CSBS}. 52 53 54 \section{Performance Comparison} 55 \label{sec:disc-perf-comp} 56 This section compares how the two schemes perform regarding CPU usage, latency, bandwidth and space. 57 Clause Schnorr has fixed key sizes with 256 bits (32 bytes), which we compare against different RSA key sizes (1024, 2048, 3072 and 4096 bits). 58 In terms of security, \gls{CSBS} 256 bit keys could be compared to 3072 bit RSA keys (see \url{https://www.keylength.com/} for more information). 59 60 \subsection{CPU Usage} 61 Various benchmarks were made on different CPU architectures. 62 This section discusses the main results, detailed information about the performance comparison can be found in appendix \ref{chap:app-perf}. 63 We thank the Taler team for providing measurements from additional systems and architectures. 64 65 Table \ref{tab:comp-cs-vs-rsa-3072} shows how \gls{CSBS} compares to RSA 3072. 66 RSA 3072 was chosen for comparison, since they both provide a comparable level of security. 67 Both provide about 128 bits of security, which means that roughly $2^{128}$ attempts in average are needed for a successful brute-force attack.\\ 68 The table shows that \gls{CSBS} has better performance compared to RSA 3072 in all operations. 69 The biggest difference can be seen in the key generation. 70 In RSA, two random primes are needed, whereas \ac{DLP} algorithms like \gls{CSBS} only need to generate a random value. 71 Since key generation is done rarely compared to the other operations, the time needed for key generation does not matter that much.\\ 72 Furthermore, the blinding in \gls{CSBS} is still faster than blinding in RSA, although in the \gls{CSBS} case the calculation is done twice. Also the derivation of $r_0,r_1$, the generation of $R_0,R_1$ and the derivation of $\alpha_0, \beta_0, \alpha_1, \beta_1$ is included in the measurement for the blinding operation of \gls{CSBS}. 73 Signing and blinding operations are much faster in \gls{CSBS}, also \gls{CSBS} signature verification is faster than RSA 3072. 74 75 \begin{bfhBox}[BFH-MediumBlue]{Setup} 76 CPU: 8-core AMD Ryzen 7 PRO 5850U \\ 77 OS: Ubuntu 21.10 Linux 5.13.0-25-generic \#26-Ubuntu SMP Fri Jan 7 15:48:31 UTC 2022 x86\_64 x86\_64 x86\_64 GNU/Linux \\ 78 libsodium version: 1.0.18-1build1 \\ 79 libgcrypt version: 1.8.7-5ubuntu2 \\\\ 80 Benchmarks with other hardware setups can be found in appendix \ref{chap:app-perf}. 81 \end{bfhBox} 82 83 \begin{table}[h] 84 \centering 85 \colorlet{BFH-table}{BFH-MediumBlue!10} 86 \colorlet{BFH-tablehead}{BFH-MediumBlue!50} 87 \setupBfhTabular 88 \begin{tabular}{llr} 89 \rowcolor{BFH-tablehead} 90 \textbf{Signature Scheme} & \textbf{Operation} & \textbf{Speed} \\\hline 91 CS & 10x key generation & 0.204 ms \\\hline 92 RSA 3072 bit & 10x key generation & 2684 ms \\\hline 93 \hline 94 CS & 10x derive $R_0, R_1$ \& blinding & 3.870 ms \\\hline 95 RSA 3072 bit & 10x blinding & 5 ms \\\hline 96 \hline 97 CS & 10x signing & 0.077 ms \\\hline 98 RSA 3072 bit & 10x signing & 86 ms \\\hline 99 \hline 100 CS & 10x unblinding & 0.001 ms \\\hline 101 RSA 3072 bit & 10x unblinding & 24 ms \\\hline 102 \hline 103 CS & 10x verifying & 1.358 ms \\\hline 104 RSA 3072 bit & 10x verifying & 3.075 ms \\\hline 105 \end{tabular} 106 \caption{Comparison on CS vs. RSA 3072} 107 \label{tab:comp-cs-vs-rsa-3072} 108 \end{table} 109 110 Table \ref{tab:comp-cs-vs-rsa-1024} shows a comparison between \gls{CSBS} and RSA 1024 bit. 111 RSA 1024 is in some situations faster than the \gls{CSBS} implementation. 112 Note that 1024 bit keys are not recommended for many use cases, but the highest currently known RSA factorization done is 829 bits \cite{enwiki:1055393696}. 113 The following section \ref{sec:disc-risk} explains the risk running RSA 1024 or \gls{CSBS} denominations further.\\ 114 The blind and unblind operations are running in a wallet implementation, therefore the comparison with RSA 1024 is very interesting for devices with less CPU power. 115 Comparison of such hardware can be found in appendix \ref{chap:app-perf}, these comparison results come to the same conclusion.\\ 116 Although RSA 1024 bit is much faster in the blinding operation, \gls{CSBS} still perform better when calculating the blinding and unblinding operations together. 117 \gls{CSBS} unblinding computes only an addition of two scalars $s + \alpha \mod p$, while RSA computes $s * r^{-1}$. 118 To conclude, \gls{CSBS} are faster than RSA 1024 bit and provide a better level of security. 119 This can be especially useful for wallets running on devices with less CPU power. 120 The verification on RSA 1024 is faster than \gls{CSBS}. 121 Therefore, it has to be further investigated which algorithm would overall perform better for the exchange or merchants. 122 While RSA 1024 bit can compete in certain operations, \gls{CSBS} provide a better level of security and are still faster in most operations. 123 124 \begin{table}[h] 125 \centering 126 \colorlet{BFH-table}{BFH-MediumBlue!10} 127 \colorlet{BFH-tablehead}{BFH-MediumBlue!50} 128 \setupBfhTabular 129 \begin{tabular}{llr} 130 \rowcolor{BFH-tablehead} 131 \textbf{Signature Scheme} & \textbf{Operation} & \textbf{Speed} \\\hline 132 CS & 10x key generation & 0.204 ms \\\hline 133 RSA 1024 bit & 10x key generation & 126 ms \\\hline 134 \hline 135 CS & 10x derive $R_0, R_1$ \& blinding & 3.870 ms \\\hline 136 RSA 1024 bit & 10x blinding & 1.282 ms \\\hline 137 \hline 138 CS & 10x signing & 0.077 ms \\\hline 139 RSA 1024 bit & 10x signing & 7 ms \\\hline 140 \hline 141 CS & 10x unblinding & 0.001 ms \\\hline 142 RSA 1024 bit & 10x unblinding & 2.991 ms \\\hline 143 \hline 144 CS & 10x verifying & 1.358 ms \\\hline 145 RSA 1024 bit & 10x verifying & 0.876 ms \\\hline 146 \end{tabular} 147 \caption{Comparison on CS vs RSA 1024} 148 \label{tab:comp-cs-vs-rsa-1024} 149 \end{table} 150 \subsection{Disk Space} 151 \begin{bfhWarnBox} 152 These are theoretical calculations, implementations may choose to persist additional values. 153 \end{bfhWarnBox} 154 \gls{CSBS} save disk space due to the much smaller key sizes. 155 Even more disk space is saved by deriving values with the \gls{hkdf}, these values do not have to be stored. 156 \\ 157 Table \ref{tab:comp-sign-space} shows the disk space comparison of signatures, the private keys alone need even less space with 256 bits per key. 158 \\ 159 The wallet saves a lot of disk space by deriving most of the values. 160 In the \gls{CSBS} case a wallet must at least persist the private key $c_s$, $R_0, R_1, s', D_p$, each being 256 bits (32 bytes). 161 A wallet needs to persist 150 bytes per coin in total. 162 In the RSA Blind Signature case the wallet persists $c_s$, $b$, $\sigma_c$, $D_p$. 163 \\Note: for refreshed coins an additional 32 byte value is persisted as seed.\\ 164 $c_s$ is still a 32 byte value in the RSA case, the other values depend on the RSA key size. (32 byte + 3 * \textit{rsa\_keysize}). 165 The disk space comparison for a wallet can be found in \ref{tab:comp-wallet-space}. 166 167 \begin{table}[ht] 168 \centering 169 \colorlet{BFH-table}{BFH-MediumBlue!10} 170 \colorlet{BFH-tablehead}{BFH-MediumBlue!50} 171 \setupBfhTabular 172 \begin{tabular}{lccr} 173 \rowcolor{BFH-tablehead} 174 \textbf{Signature Scheme} & \textbf{Disk Space} & \textbf{Factor} & \textbf{Disk Space 1M signatures}\\\hline 175 CS & 512 bits & 1x & 64 MB\\\hline 176 RSA 1024 bit & 1024 bits & 2x & 128 MB \\\hline 177 RSA 2048 bit & 2048 bits & 4x & 256 MB\\\hline 178 RSA 3072 bit & 3072 bits & 6x & 384 MB\\\hline 179 RSA 4096 bit & 4096 bits & 8x & 512 MB\\\hline 180 \end{tabular} 181 \caption{Comparison disk space signatures} 182 \label{tab:comp-sign-space} 183 \end{table} 184 185 \begin{table}[ht] 186 \centering 187 \colorlet{BFH-table}{BFH-MediumBlue!10} 188 \colorlet{BFH-tablehead}{BFH-MediumBlue!50} 189 \setupBfhTabular 190 \begin{tabular}{lccr} 191 \rowcolor{BFH-tablehead} 192 \textbf{Signature Scheme} & \textbf{Disk Space} & \textbf{Factor} & \textbf{Disk Space 1M coins}\\\hline 193 CS 256 bits & 150 bytes & 1x & 150 MB\\\hline 194 RSA 1024 bit & 416 bytes & 2.7x & 416 MB \\\hline 195 RSA 2048 bit & 800 bytes & 5.3x & 800 MB\\\hline 196 RSA 3072 bit & 1184 bytes & 7.9x & 1184 MB\\\hline 197 RSA 4096 bit & 1568 bytes & 10.4x & 1568 MB\\\hline 198 \end{tabular} 199 \caption{Comparison disk space wallet} 200 \label{tab:comp-wallet-space} 201 \end{table} 202 203 \subsection{Bandwidth} 204 \begin{bfhWarnBox} 205 These are theoretical calculations, implementations may choose to persist additional values. 206 \end{bfhWarnBox} 207 The reasons that \gls{CSBS} use less bandwidth is mostly because the signature/key sizes are much smaller. 208 The bandwidth improvements for the \texttt{/keys} API is the same as specified in the table with disk space comparison \ref{tab:comp-sign-space}. 209 For \gls{CSBS} many calculations are performed twice, therefore also two values are submitted. 210 Table \ref{tab:comp-band-withd} compares the bandwidth used in a withdrawal. 211 The 32 byte values $2 * n_w, 2 * D_p, R_0, R_1, s,W_p, c_0, c_1, \sigma_W$ as well as an integer $b$ are transmitted for \gls{CSBS}.\\ 212 For RSA, the values $D_p, m', \sigma'_c$ have the same size as the key size. 213 Additionally, the 32 byte values $W_p, \sigma_W$ are transmitted. 214 \\\\ 215 In the refresh protocol the only difference is an additional hash ($h_{C_0}, h_{C_1}$ instead of only $h_C$) sent in the commit phase. 216 Depending on the hash size another 32 byte (or 64 byte) value is transmitted. 217 218 \begin{table}[ht] 219 \centering 220 \colorlet{BFH-table}{BFH-MediumBlue!10} 221 \colorlet{BFH-tablehead}{BFH-MediumBlue!50} 222 \setupBfhTabular 223 \begin{tabular}{lccr} 224 \rowcolor{BFH-tablehead} 225 \textbf{Signature Scheme} & \textbf{Bandwidth used} & \textbf{Factor} & \textbf{1M coins}\\\hline 226 CS 256 bits & 356 bytes & 1x & 324 MB\\\hline 227 RSA 1024 bit & 448 bytes & 1.3x & 448 MB \\\hline 228 RSA 2048 bit & 832 bytes & 2.5x & 832 MB\\\hline 229 RSA 3072 bit & 1216 bytes & 3.75x & 1216 MB\\\hline 230 RSA 4096 bit & 1600 bytes & 4.9x & 1600 MB\\\hline 231 \end{tabular} 232 \caption{Bandwidth comparison withdrawal} 233 \label{tab:comp-band-withd} 234 \end{table} 235 236 \subsection{Latency} 237 This section the notion of \acl{RTT} (see \cite{geeks:rtt}) is used. 238 There are many factors that influence the measurement of a \acl{RTT}. 239 Following factors can bring huge changes in the value of \ac{RTT}s. 240 \begin{itemize} 241 \item Distance 242 \item Transmission medium 243 \item Network hops 244 \item Traffic levels 245 \item Server response time 246 \end{itemize} 247 All of these factors will vary in reality and are independent of the scheme.\\ 248 The important comparison here is the number of \ac{RT}s as in table \ref{tab:comp-rtt}. 249 \begin{table}[ht] 250 \centering 251 \colorlet{BFH-table}{BFH-MediumBlue!10} 252 \colorlet{BFH-tablehead}{BFH-MediumBlue!50} 253 \setupBfhTabular 254 \begin{tabular}{lc} 255 \rowcolor{BFH-tablehead} 256 \textbf{Signature Scheme} & \textbf{Number of RTs} \\\hline 257 RSA Blind Signatures & 1\\\hline 258 Clause Blind Schnorr Signatures & 2\\\hline 259 \end{tabular} 260 \caption{Comparison of Round-Trips} 261 \label{tab:comp-rtt} 262 \end{table} 263 264 While creating \gls{RSABS} have one \ac{RT}, \gls{CSBS} need an additional \ac{RT} for requesting the public $R_0, R_1$. 265 This means that the time spend for withdrawing is almost \textbf{doubled} (the $ R $ request doesn't have any persistence and therefore requires less time) in comparison to RSA. 266 267 A coin should not be spent immediately after withdrawal or refresh. 268 Otherwise, an adversary could deanonymize a customer by correlating the timestamps. 269 The additional \ac{RT} is a drawback of \gls{CSBS} compared to RSA, but negligible due to the fact that a coin must not be spent immediately. 270 271 \section{Security Assumptions} 272 \label{sec:disc-sec-assumptions} 273 This section discusses the differences regarding the security assumptions of the schemes. 274 This section should not explain nor analyze the security assumptions, instead the section focuses on explaining what these assumptions mean and what should be kept in mind about them. 275 Read section \ref{sec:sign-schemes} and it's references for more information on the assumptions. 276 277 RSA's security assumptions are well known since quite a long time and a lot of research is done. 278 Despite being a lot of attacks \cite{ganapati:rsactftool} \cite{perez:stoprsa}, RSA is still considered a secure scheme after decades.\\ 279 For Schnorr Signatures the \acl{DLP} (see \autoref{sec:dlp}) needs to be hard. 280 Also the \ac{DLP} is well-known and is being researched since decades.\\ 281 However, with Blind Schorr Signatures an additional assumption needs to hold; the \ac{ROS} problem. 282 Compared to the other assumptions, \ac{ROS} is relatively new and still a recent research topic. 283 A recent paper from 2020 on the (in)security of ROS \cite{cryptoeprint:2020:945} broke many schemes relying on ROS being hard, including Schnorr Blind signatures. 284 The paper on which we rely on (updated in 2021) with the Clause Blind Schnorr Signature Scheme \cite{cryptoeprint:2019:877} is considered secure at the time of writing.\\ 285 286 \section{Risk} 287 \label{sec:disc-risk} 288 As introduced in \autoref{sec:disc-sec-assumptions}, \gls{CSBS} rely on an additional assumption currently being researched. 289 Compared to other schemes, the chosen \gls{CSBS} are very new (published in 2019, updated in 2021). 290 While every scheme could potentially be broken, older ones already went through a lot of research and their assumptions are well-known. 291 Therefore, the risk that a vulnerability in \gls{CSBS} will be discovered is probably higher than a newly discovered vulnerability breaking RSA. 292 293 Unpredictability of $ r $ is a key aspect of the signature creation process of \gls{CSBS}. 294 The redesigned Taler protocols solve this by persisting the nonce and denomination key (described in \autoref{sec:withdraw-protocol-impl}) and checking for reuse of this combination before signature creation. 295 If this process is malfunctioning (broken implementation, faulty database) or can be circumvented in any way, recovery of a denomination private key is possible. 296 297 An exchange operator can still consider using \gls{CSBS} as denomination scheme, as there are multiple benefits (see \autoref{sec:disc-perf-comp}). 298 The financial loss in the worst case can be calculated and capped by the validity of a denomination key. 299 If a vulnerability in the \gls{CSBS} would be detected, an exchange operator could revoke the corresponding denomination keys and change the scheme to \gls{RSABS}. 300 The wallets can then follow the refund protocol to get the money back. 301 302 \section{Comparison Conclusion} 303 \label{sec:disc-comp-conclusion} 304 A detailed comparison of the two blind signature schemes was made. 305 This last section interprets the results and concludes the comparison. 306 307 \gls{CSBS} on \gls{25519} provide the same security level as \gls{RSABS} with 3072 bit key sizes. 308 The implementation of \gls{CSBS} is the clear winner in all performance comparisons with RSA 3072 bits. 309 310 1024 bit RSA is faster than the \gls{CSBS} implementation in certain operations. 311 The \gls{CSBS} implementation still offers better performance for wallets with less CPU power and provides a much higher level of security (comparable to RSA 3072). 312 As further comparisons show, RSA scales very bad the larger the keys get and \gls{CSBS} performs much better overall. 313 314 As discussed in the risk section \ref{sec:disc-risk}, \gls{CSBS} have an additional security assumption, which is still a recent research topic. 315 \gls{CSBS} provide various benefits and the risk can be calculated and capped. 316 An exchange operator who is aware of the discussed risk can use \gls{CSBS} safely. 317 \gls{CSBS} are best suited for denominations with low value, where many coins are being withdrawn/refreshed.