<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>p5750</author_name>
  <author_url>https://blog.hatena.ne.jp/p5750/</author_url>
  <blog_title>ろまとふのtech blog</blog_title>
  <blog_url>https://p5750-tech.hateblo.jp/</blog_url>
  <categories>
    <anon>Go</anon>
    <anon>備忘録</anon>
    <anon>AES</anon>
  </categories>
  <description>※ この記事は、2021年3月にQiitaに投稿した記事を移植したものです。 はじめに Goで暗号化・復号の処理を書いたときに（主にパディングで）手こずったのでメモ。 暗号化 流れ AES-128-CBCによる暗号化は以下のような流れで行う。 秘密鍵 (128 bit) の用意 IV (128 bit) の生成 パディング 暗号化 秘密鍵 (128 bit) の用意 省略。 IV (128 bit) の生成 IVは長さ16のランダムな byte 配列になる。この長さはAESにおけるブロックサイズなので、定数 aes.BlockSize が使える。 import ( &quot;crypto/aes&quot; &quot;…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fp5750-tech.hateblo.jp%2Fentry%2Fgolang-aes-cipher&quot; title=&quot;Goで暗号化する備忘録（AES-128-CBC） - ろまとふのtech blog&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url></image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2022-04-14 20:42:05</published>
  <title>Goで暗号化する備忘録（AES-128-CBC）</title>
  <type>rich</type>
  <url>https://p5750-tech.hateblo.jp/entry/golang-aes-cipher</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
