lib/megar/session.rb
# Command: decrypt/decode the login +response_data+ received from Mega
#
# Javascript reference implementation: function api_getsid2(res,ctx)
#
decrypt/decode the login +response_data+ received from Mega
Javascript reference implementation: function api_getsid2(res,ctx)
decrypt / decode the login + response_data + received from Mega Javascript reference implementation : function api_getsid2 ( res ctx )
def handle_login_challenge_response(response_data)
    if k = response_data['k']
      enc_master_key = base64_to_a32(k)
      self.master_key = decrypt_key(enc_master_key, password_key)
    end
    if privk = response_data['privk']
      self.rsa_private_key = decrypt_base64_to_str(privk, master_key)
      self.decomposed_rsa_private_key = decompose_rsa_private_key(rsa_private_key)
      if csid = response_data['csid']
        self.sid = decrypt_session_id(csid,decomposed_rsa_private_key)
      end
    end
  end
def handle_login_challenge_response ( response_data ) if k = response_data [ 'k' ] enc_master_key = base64_to_a32 ( k ) self . master_key = decrypt_key ( enc_master_key , password_key ) end if privk = response_data [ 'privk' ] self . rsa_private_key = decrypt_base64_to_str ( privk , master_key ) self . decomposed_rsa_private_key = decompose_rsa_private_key ( rsa_private_key ) if csid = response_data [ 'csid' ] self . sid = decrypt_session_id ( csid , decomposed_rsa_private_key ) end end end
Command: decrypt/decode the login +response_data+ received from Mega
Javascript reference implementation: function api_getsid2(res,ctx)
Command : decrypt / decode the login + response_data + received from Mega Javascript reference implementation : function api_getsid2 ( res ctx )
response_data