## 4 The Proposed HMPS Technique  
The novelty of the proposed scheme is the creation of a hierarchical multiparty signing (MPS) that includes both the signature and the message in ciphertext linear computation, where this signature is calculated using the modified ElGamal cryptosystem. Our scheme adopts a symmetric-like structure where the system secret key, \(s\), remains unknown to external entities and is shared only within the system. This structural modification enhances security by preventing external attackers from performing standard ElGamal cryptanalysis. Therefore, our scheme introduces an HMPS mechanism that integrates linear encryption to facilitate collaborative and efficient authentication in resource-constrained environments. Unlike traditional signatures, which rely on single-party signing and verification, our method leverages hierarchical aggregation to provide enhanced integrity, scalability, and resistance to forgery. In addition to KeyGen function, the protocol has first encryption (FEnc), message encryption (Enc), decryption (Dec), individual signature (IndS), hierarchic verification (HSig), and last verification (LVerf) functions. As illustrated in Algorithm 1, the individual signature IndS has inputs of plaintext \(m\), private-public keys \(k,y\), and public parameters \(g\), \(p\). IndS returns the pair \((a,b)\). ```
0:\(m\), \(y\), \(k\), \(g\), \(p\)
1:functionIndS
2:\(r\)\(\leftarrow\)\(\mathbb{Z}\)
3:\(h\)\(\leftarrow\)\(\mathit{Hash}(m)\)
4:\(h^{\prime}\)\(\leftarrow\)\(\mathit{Hash}(h)\)
5:\(b\)\(\leftarrow\)\(y^{\prime}\mod p\)
6:\(a\)\(\leftarrow\)\(k\times(h\times b-h^{\prime}\times r)\mod(p-1)\)
7: return \(a,b\)
8:endfunction
```  
**Algorithm 1** Individual signature. The creator uses the first encryption (FEnc) function, which has inputs of plaintext \(m\), own private-public keys \(k,y\), system secret key \(s\), and public parameters \(g\), \(p\). FEnc uses the linear encryption scheme shown in Equation (6). \[c=A\times s+m \tag{6}\]  
where \(A\) is the first part of the computed signature by IndS. For each message \(m_{i}\), \(c_{i}=A_{i}\times s+m_{i}\). Algorithm 2 illustrates the first encryption function. ```
0:\(s\), \(m\), \(y\), \(k\), \(g\), \(p\)
1:functionFEnc
2:\(A\), \(B\)\(\leftarrow\)\(\mathit{IndS}(m,y,k,g,p)\)
3:\(c\)\(\leftarrow\)\(A\times s+m\)
4:\(Y\)\(\leftarrow\)\(y^{B}\mod p\)
5: return \(c\), \(B\), \(Y\)
6:endfunction
```  
**Algorithm 2** First encryption. ```
0:\(s\), \(m\), \(A\)
1:functionEnc
2:\(c\)\(\leftarrow\)\(A\times s+m\)
3: return \(c\)
4:endfunction
```  
**Algorithm 3** Encryption. ```
0:\(s\), \(m\), \(A\)
1:functionEnc
2:\(c\)\(\leftarrow\)\(A\times s+m\)
3: return \(c\)
4:endfunction
```  
**Algorithm 4** First encryption. ```
0:\(s\), \(m\), \(A\)
1:functionEnc
2:\(c\)\(\leftarrow\)\(A\times s+m\)
3: return \(c\)
4:endfunction
```  
**Algorithm 5** First encryption. ```
0:\(s\), \(m\), \(A\)
1:functionEnc
2:\(c\)\(\leftarrow\)\(A\times s+m\)
3: return \(c\)
4:endfunction
```  
**Algorithm 6** First encryption. The decryption (Dec) function has as inputs the ciphertext \(c\) and the secret key of the system \(s\). Dec uses the linear decryption scheme shown in Algorithm 4. ```
1:\(c,s\)
2:functionDec
3:\(m\gets c\mod s\)\(\triangleright\)\(m\) must be less than \(s\)
4:\(A\leftarrow\frac{(c-m)}{s}\)
5:return \(A,m\)
6:endfunction
```  
**Algorithm 4** Decryption. The hierarchic signature (HSig) function has as inputs the message \(m\), the signature \(\sigma=(A,B,Y)\) where \(A\) is contained in the cipher \(c\), the private-public keys \(k,y\), the public parameters \(g\), \(p\), and the system secret key \(s\). HSig is illustrated in Algorithm 5.