 
   _encryptToJson: (data) ->
     data = _(data).chain().pairs().sort().object().value()
-    '{' + (JSON.stringify(@_preprocessKey(key)) + ':' + JSON.stringify(@_preprocessValue(value)) for key, value of data).join(',') + '}'
+    '{' + (JSON.stringify(@_aes.encrypt(key)) + ':' + JSON.stringify(@_aes.encrypt(value)) for key, value of data).join(',') + '}'
 
   _decrypt: (data) ->
     out = {}
-    out[@_deprocessKey(key)] = @_deprocessValue(value) for key, value of data
+    out[@_aes.decrypt(key)] = @_aes.decrypt(value) for key, value of data
     out
      return yes if @_lastMd5 is md5
      @client.get_settings().then (data) =>
        l "Decrypt", _.clone(data)
        data = Try(=> @_decrypt(data)).getOrElse({})
        l "After decrypt", data
        @_merge(data).then =>
          @_setLastMd5(md5)
          @emit 'pulled'

  constructor: (name, addr, key, auxiliaryStore = ledger.storage.wallet) ->
    super(name)
    @_secureStore = new ledger.storage.SecureStore(name, key)
    @_aes = @_secureStore._aes
    @mergeStrategy = @_overwriteStrategy
    @client = ledger.api.SyncRestClient.instance(addr)
    @throttled_pull = _.throttle _.bind((-> @._pull()),@), @PULL_THROTTLE_DELAY, trailing: no
