Skip to content

Instantly share code, notes, and snippets.

@kjunichi
Last active September 9, 2024 06:28
Show Gist options
  • Save kjunichi/1dd6c6151e24ce016ce5bb4174bd2f63 to your computer and use it in GitHub Desktop.
Save kjunichi/1dd6c6151e24ce016ce5bb4174bd2f63 to your computer and use it in GitHub Desktop.

暗号関連

カウンターモード

パディングが不要

AES-256-GCMのIVの長さ

12バイトらしい。 カウンターの4バイトは含めない模様。

irb(main):001:0> require 'openssl'
=> true
irb(main):002:0> cipher = OpenSSL::Cipher.new("AES-256-GCM")
=> #<OpenSSL::Cipher:0x00007fddb10d4198>
irb(main):003:0> cipher.iv_len
=> 12
irb(main):004:0> 
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment