<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>AES on seth-shi</title><link>https://sethix.com/tags/aes/</link><description>Recent content in AES on seth-shi</description><generator>Hugo -- gohugo.io</generator><language>en</language><lastBuildDate>Wed, 07 Sep 2022 16:52:05 +0800</lastBuildDate><atom:link href="https://sethix.com/tags/aes/index.xml" rel="self" type="application/rss+xml"/><item><title>Application of AES Encryption Algorithm</title><link>https://sethix.com/posts/2022090716/</link><pubDate>Wed, 07 Sep 2022 16:52:05 +0800</pubDate><guid>https://sethix.com/posts/2022090716/</guid><description>Recently, I&amp;rsquo;ve been working on integrating third-party advertising bidding services. Most advertising platforms with bidding capabilities encrypt their bid prices using the AES algorithm.
When integrating with third parties, challenges arise due to varying encryption modes and the lack of SDKs (some only provide Java client code examples). Here are some practical approaches:
Use third-party validation tools like https://tool.lmeee.com/jiami/aes for cross-verification Analyze Java code to identify critical encryption parameters: Encryption Mode (ECB, CBC, CFB, OFB) Padding Method (pkcs5padding, pkcs7padding, zeropadding) Key Length (128-bit/8-char key, 192-bit/12-char key, 256-bit/16-char key) IV (Initialization Vector - some require random values, others use fixed values) Base64UrlSafe Encoding requirement for ciphertext Practical Observations: ECB Dominance: Many platforms use ECB mode for simplicity despite security risks, as it requires only a key (no IV).</description></item><item><title>Cross-Service Data Verification Using AES Algorithm</title><link>https://sethix.com/posts/2021051112/</link><pubDate>Tue, 11 May 2021 12:41:39 +0800</pubDate><guid>https://sethix.com/posts/2021051112/</guid><description>Recently while working on an advertising service that requires cross-application data transmission between backend services (PHP + Go), we chose symmetric encryption for implementation.
Common Pitfalls Key Length Errors may occur if using a 32-bit key (since documentation states valid lengths are 16, 24, 32)
AES-128: Requires 16-byte key
AES-192: Requires 24-byte key
AES-256: Requires 32-byte key
Always match key length to the selected algorithm.
Padding Algorithm Easily overlooked in PHP due to simple usage: $text = &amp;#34;String to encrypt&amp;#34;; // Key length must match algorithm requirements $key = &amp;#34;2bfbd593bb32b2b9&amp;#34;; // AES-128-ECB depends on chosen algorithm openssl_encrypt($text, &amp;#39;AES-128-ECB&amp;#39;, $key); The above produces base64-encoded output by default.</description></item></channel></rss>