الخوارزميات التفصيلية والكود الزائف للمنظومة
يقدم هذا الفصل التوصيف الخوارزمي الدقيق والكود الزائف (Pseudo-code) لكافة محركات المنظومة.
١. الكود الزائف لوحدة واجهة المستخدم
سير عمل واجهة المرسل (شكل ٤.١١)
Algorithm 1: Sender-Side UI Pipeline
Input : CoverText C, PlainSecret M, StegoKey K_s, EncKey K_e, Hint H
Output: StegoText S_out
1: CheckCapacity(C, M)
2: P_raw ← FormatPayload(M, H)
3: P_comp ← BrotliCompressAdaptive(P_raw)
4: C_bytes ← AES_CTR_Encrypt(P_comp, K_e, Salt(C))
5: Pos ← CSPRNG_FisherYates(K_s, Salt_domain, |C_bytes|*8, |C|*16)
6: XOR_Key ← Bitwise_XOR(C, Pos, C_bytes)
7: VS_Chars ← Map_Bytes_To_VS(XOR_Key)
8: S_out ← VS_Chars + (FakeCover ? FakeCover : C)
9: Return S_out٢. خوارزمية محرك الماسح (شكل ٤.١٣)
Algorithm 2: Scanner Transcript Processing
Input : TranscriptText T, Keys {K_s, K_e}
Output: List of Decrypted Messages
1: Lines ← SplitLines(T)
2: For each Line in Lines:
3: If HasVariationSelectors(Line):
4: VS_Bytes ← ExtractVS(Line)
5: Payload ← AttemptDecrypt(VS_Bytes, Line, K_s, K_e)
6: If Payload.isValid:
7: CandidateList.add(Payload)
8: Return CandidateList٣. المحرك المكاني للإخفاء (شكل ٤.١٦)
Algorithm 3: CSPRNG Unbiased Spatial Placement
Input : StegoKey K_s, Salt, Count K, MaxLength N
Output: Unique Indices Array Pos[0...K-1]
1: Key256 ← PBKDF2(K_s, Salt, 100000)
2: PRNG ← AES_CTR_DRBG_Init(Key256)
3: IndicesMap ← EmptyMap()
4: For i from 0 to K-1:
5: j ← PRNG.NextUnbiasedInt(i, N-1)
6: val_j ← IndicesMap.get(j) || j
7: val_i ← IndicesMap.get(i) || i
8: IndicesMap.set(j, val_i)
9: Pos[i] ← val_j
10: Return Pos