# How does APE: Authenticated Permutation-Based Encryption work?

I am trying to understand the encryption and decryption process of the APE: APE: Authenticated Permutation-Based Encryption for Lightweight Cryptography

Full paper

what is exactly the Vc and the Vr here? Example instead of the permutation p, what if I decide to replace it with a block cipher? Will the Vc be the key for the block cipher? What will the Vr then be which is xor'ed with the Plaintext?

A simple human-readble pseudo code will be helpful. I started trying to rewrite the pseudo code but there soo many unanswered questions.

[CipherText, Tag] function Encrypt(Key, A, Plaintext):
begin
u = len(A)
w = total number of blocks in the plaintext// eg. 1 block 64 bit block size
V = [0,....K]
if(A not zero) then
A = {A .... A[u]}
for i = 1 to u do
V = p(A[i] xor Vr, Vc) // can replace this with block cipher eg bcp(plaintext,key)
end
endif

V = V xor [0,1] // What is (0,1)?
M = {Plaintext,.......Plaintext[w]} // devide into blocks eg. 64 bits each.
for i = 1 to w do
V = p(M[i] xor Vr, Vc) // what is the Vr and Vc here?
C[i] = Vr
end

CipherText = {C,.......C[w]}
Tag = Vc Xor Key // what is the Vc here from?
end

• r and c stands for rate and capacity respectively. and no, you can't replace the permutation with a block cipher, because the capacity part is volatile throughout the process, where as the key is static in the block cipher. – DannyNiu Sep 18 '20 at 7:12
• @DannyNiu Thanks for your feedback. So it means I am taking from the V(that is the key) r bits and V(again the key) c bits and passing it to the permutation function. Then what is the difference between the V on line 1 and 5? – Seek Addo Sep 18 '20 at 7:21
• Ahh I see, so if I want to use this with a block cipher then i might have to change the whole logic here right? – Seek Addo Sep 18 '20 at 7:22