【问题标题】:Retrieve Encrypted data from the JSONStore in IBM MobileFirst从 IBM MobileFirst 中的 JSONStore 检索加密数据
【发布时间】:2015-10-06 18:17:26
【问题描述】:

我创建了一个 JSONStore 并尝试加密集合中的数据。 我的理解是,AES 加密是通过使用用户名和密码保护集合来完成的;我通过设置localKeyGen : true 成功做到了这一点。

但是我仍然收到纯文本作为响应。

JSONStore

 var collectionName = 'people';

// Object that defines all the collections.
var collections = {

  // Object that defines the 'people' collection.
  people : {

    // Object that defines the Search Fields for the 'people' collection.
    searchFields : {name: 'string', age: 'integer'}
  }
};

// Optional options object.
var options = {

  // Optional username, default 'jsonstore'.
  username : 'carlos',

  // Optional password, default no password.
  password : '123',

  // Optional local key generation flag, default false.
  localKeyGen : true
};

WL.JSONStore.init(collections, options)

.then(function () {

  // Data to add, you probably want to get
  // this data from a network call (e.g. Worklight Adapter).
  var data = [{name: 'carlos', age: 10}];

  // Optional options for add.
  var addOptions = {

    // Mark data as dirty (true = yes, false = no), default true.
    markDirty: true
  };

  // Get an accessor to the people collection and add data.
  return WL.JSONStore.get(collectionName).add(data, addOptions);
})

.then(function (numberOfDocumentsAdded) {
  // Add was successful.
})

.fail(function (errorObject) {
   // Handle failure for any of the previous JSONStore operations (init, add).
});

回应

{"collection":{"name":"people","username":"carlos","searchFields":{"name":"string","age":"integer","_id":"number"},"additionalSearchFields":{},"promise":{}},"docs":[{"_id":1,"json":{"age":10,"name":"carlos"}}]}

如何检索加密数据?如果已通过使用用户名和密码保护集合进行加密。

参考文献

【问题讨论】:

    标签: encryption ibm-mobilefirst jsonstore


    【解决方案1】:

    加密只是为了防止访问 JSONStore。

    通过使用用户名和密码对其进行初始化,这意味着您已成功访问它,因此您可以看到其中的集合。

    如果 .init 失败,您将根本无法检索开始的数据。

    【讨论】:

    • 这是否意味着安全机制仅限于通过用户名和密码保护 JSONStore。我们不能通过 AES 加密这些存储中的数据吗?再有一个查询,是否首先通过密码进行了加密,是否使用了 IBMWorklight Toolkit 中已经包含的 SQLCipher?
    • 集合、数据已加密。
    • 好的,我们可以通过任何方式查看加密的集合/数据吗?
    • 你能帮我解决我之前的查询@IdanAdar
    猜你喜欢
    • 2015-06-04
    • 2020-01-25
    • 2014-08-07
    • 2023-03-05
    • 2013-08-09
    • 2016-04-07
    • 2015-02-16
    • 2016-05-21
    • 2016-05-24
    相关资源
    最近更新 更多