   LOGGED_IN : 1
   VERIFIED : 2
   WAITING_FOR_INPUT : 3
+
+ENCODING = "base64"
+C = CryptoJS
 
 ##=======================================================================
 

    @_doc = @_eng.doc
    @_session = null
    @_inp = null

  #-----------------------------------------


  do_fetch : () ->
    await @prepare_keys defer ok
    await @fetch_records defer recs if ok
    ok = @decrypt_recs if recs? and ok

  #-----------------------------------------

  decrypt_error : (e) ->
    @_decrypt_errors.push e
   
  #-----------------------------------------

  decrypt_record : (k,v) ->
    k = @decrypt k, "key"
    v = @decrypt v, "value"
    @_records[k] = v if k? and v?
    
  #-----------------------------------------

  decrypt_records : (encoded_recs) ->
    @_decrypt_errors = []
    for k, v of encoded_recs
      @decrypt_record k, v
    return ok
   
  #-----------------------------------------

  check_res : (res) -> 
