CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
rapid7

Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.

GitHub Repository: rapid7/metasploit-framework
Path: blob/master/lib/rex/proto/bcrypt_public_key.rb
Views: 11655
1
# -*- coding: binary -*-
2
3
require 'bindata'
4
5
module Rex::Proto
6
# [_BCRYPT_RSAKEY_BLOB](https://github.com/tpn/winsdk-10/blob/9b69fd26ac0c7d0b83d378dba01080e93349c2ed/Include/10.0.14393.0/shared/bcrypt.h#L390)
7
class BcryptPublicKey < BinData::Record
8
MAGIC = 0x31415352
9
endian :little
10
11
uint32 :magic, initial_value: MAGIC
12
uint32 :key_length
13
uint32 :exponent_length, :value => lambda { exponent.length }
14
uint32 :modulus_length, :value => lambda { modulus.length }
15
uint32 :prime1_length, :value => lambda { prime1.length }
16
uint32 :prime2_length, :value => lambda { prime2.length }
17
18
string :exponent, :read_length => :exponent_length
19
string :modulus, :read_length => :modulus_length
20
string :prime1, :read_length => :prime1_length
21
string :prime2, :read_length => :prime2_length
22
end
23
end
24
25
26