lib/megar/crypto/support.rb
def encrypt_file_attributes(attributes, key)
    rstr = 'MEGA' + attributes.to_json
    if (mod = rstr.length % 16) > 0
      rstr << "\x0" * (16 - mod)
    end
    aes_cbc_encrypt(rstr, a32_to_str(key))
  end
# Returns encrypted file attributes given encrypted +attributes+ and decomposed file +key+
#
# Javascript reference implementation: function enc_attr(attr,key)
#
Returns encrypted file attributes given encrypted +attributes+ and decomposed file +key+
Javascript reference implementation: function enc_attr(attr,key)
Returns encrypted file attributes given encrypted + attributes + and decomposed file + key + Javascript reference implementation : function enc_attr ( attr key )
def encrypt_file_attributes(attributes, key)
    rstr = 'MEGA' + attributes.to_json
    if (mod = rstr.length % 16) > 0
      rstr << "\x0" * (16 - mod)
    end
    aes_cbc_encrypt(rstr, a32_to_str(key))
  end
def encrypt_file_attributes ( attributes , key ) rstr = 'MEGA' + attributes . to_json if ( mod = rstr . length % 16 ) > 0 rstr << "\x0" * ( 16 - mod ) end aes_cbc_encrypt ( rstr , a32_to_str ( key ) ) end
Returns encrypted file attributes given encrypted +attributes+ and decomposed file +key+
Javascript reference implementation: function enc_attr(attr,key)
Returns encrypted file attributes given encrypted + attributes + and decomposed file + key + Javascript reference implementation : function enc_attr ( attr key )
attributes
key