diff --git a/_browser/blockstack_storage.md b/_browser/blockstack_storage.md index d8d06648..0d98e5b7 100644 --- a/_browser/blockstack_storage.md +++ b/_browser/blockstack_storage.md @@ -404,6 +404,8 @@ These are the `UserSession.putFile`, `UserSession.getFile`, and `lookupProfile` } ``` + The default behavior for `putFile()` is to encrypt data when storing it, making it unreadable by everyone except the logged in user. In this example `putFile()` call is not encrypting the status because our app is meant to share statuses publicly. + 9. Save the `Profile.js` file. After the application compiles successfully, your application should appears as follows: @@ -458,6 +460,7 @@ Update `Profile.js` again. }) } ``` + By default, `getFile()` this method decrypts data; because the default `putFile()` encrypts it. In this case, the app shares statuses publicly. So, there is no need to decrypt. 5. Call `fetchData()` from the `componentDidMount()` method. @@ -770,8 +773,6 @@ process URL paths that contain the `.` (dot) character for example, Congratulations, you are all done! We hope you've enjoyed learning a bit more about Blockstack. -A few things to note, you'll notice that in our `putFile()` and `getFile()` calls, we chose not to encrypt/decrypt because our app is meant to share statuses publicly. By default, `putFile()` and `getFile()` will encrypt all data stored, making it unreadable by everyone except the logged in user. - ## Resources [Complete source code](https://github.com/yknl/publik) diff --git a/_browser/todo-list.md b/_browser/todo-list.md index 96a9043f..bb6d5ae3 100644 --- a/_browser/todo-list.md +++ b/_browser/todo-list.md @@ -310,7 +310,6 @@ watch: { handler: function (todos) { const UserSession = this.UserSession - // encryption is now enabled by default return UserSession.putFile(STORAGE_FILE, JSON.stringify(todos)) }, deep: true @@ -320,14 +319,14 @@ watch: { The `todos` JSON object is passed in and the [`blockstack.UserSession.putFile()`](https://blockstack.github.io/blockstack.js/#putfile) -method to store it in a Gaia Hub. +method to store it in a Gaia Hub. By default, `putFile()` encrypts data when it stores it. The code needs to read the Todo items from the storage with the [`blockstack.UserSession.getFile()`](https://blockstack.github.io/blockstack.js/#getfile) method which returns a promise: ```js fetchData () { const UserSession = this.UserSession - UserSession.getFile(STORAGE_FILE) // decryption is enabled by default + UserSession.getFile(STORAGE_FILE) .then((todosText) => { var todos = JSON.parse(todosText || '[]') todos.forEach(function (todo, index) { @@ -339,7 +338,7 @@ fetchData () { }, ``` -The `todos` data is retrieved from the promise. +The `todos` data is retrieved from the promise. By default, the `getFile()` decrypts data for you. For more information on the available options, see the the blockstack.js library for details on the `GetFileOptions` interface. ## Summary diff --git a/_core/attic/gaia.md b/_core/attic/gaia.md index b63e0536..086a86a5 100644 --- a/_core/attic/gaia.md +++ b/_core/attic/gaia.md @@ -34,7 +34,7 @@ collection of data that is backed by one or more existing storage systems. When a user logs into an application, the application will create or connect to the datastore that holds the user's data. Once connected, it can proceed to interact with its data via POSIX-like functions: `mkdir`, `listdir`, `rmdir`, -`getFile`, `putFile`, `deleteFile`, and `stat`. +`getFile()`, `putFile()`, `deleteFile`, and `stat`. A datastore has exactly one writer: the user that creates it. However, all data within a datastore is world-readable by default, so other users can see the diff --git a/_data/glossary.csv b/_data/glossary.csv index b4805444..3601874e 100644 --- a/_data/glossary.csv +++ b/_data/glossary.csv @@ -33,7 +33,7 @@ identity management (IDM),"Identity management, also known as identity and acces know your customer (KYC),"Or KYC, is a popular term used in the banking or financial field. KYC is a process where financial institutions, insurers and other companies obtain information about the identity and address of the customers as part of risk management." KYC,See know your customer light clients,Clients that can independently validate the existence of transactions by downloading only block headers and not the entire blockchain. -Magic Recovery Code,"
An long encrypted string, for example:
36mWivFdy0YPH2z31EflpQz/Y0UMrOrJ++lH=0EI7c3mop2JuRBm5WXxSTazJsUjOA...
Do not share the QR code that accompanied your code either. This is a QR code:
An long encrypted string, for example:
36mWivFdy0YPH2z31EflpQz/Y0UMrOrJ++lH=0EI7c3mop2JuRBm5WXxSTazJsUjOA...
Do not share the QR code that accompanied your recovery code either. This is a QR code:
putFile()
stores the data provided in the
-user's DApp data store. You can view the URL for the data store from a user's
-profile.
+user's DApp data store. By default, `putFile()` stores data in an encrypted format which means only the user that stored it can view it. You can view the URL for the data store from a user's profile. Because this application wants other users to view the persona and territory, the data is not encrypted, so the `encrypt` option is set to `false`.
If you tested your Animal Kingdom, you can see this on your profile. To see your
profile, go to the Blockstack
diff --git a/_develop/zero_to_dapp_3_win.md b/_develop/zero_to_dapp_3_win.md
index 3227c386..e9d679c2 100644
--- a/_develop/zero_to_dapp_3_win.md
+++ b/_develop/zero_to_dapp_3_win.md
@@ -155,7 +155,7 @@ Most of the imports in this file are locally coded React components. For example
The `loadMe()` code uses the Blockstack's `UserSession.getFile()` method to get
the specified file from the applications data store. If the users' data store on
Gaia does not have the data, which is the case for new users, the Gaia hub
-responds with HTTP `404` code and the `getFile` promise resolves to null. If you
+responds with HTTP `404` code and the `getFile()` promise resolves to null. If you
are using a Chrome Developer Tools with the DApp, you'll see these errors in a
browser's developer **Console**.
@@ -177,8 +177,7 @@ saveMe(me) {
The Blockstack putFile()
stores the data provided in the
-user's DApp data store. You can view the URL for the data store from a user's
-profile.
+user's DApp data store. By default, `putFile()` stores data in an encrypted format which means only the user that stored it can view it. You can view the URL for the data store from a user's profile. Because this application wants other users to view the persona and territory, the data is not encrypted, so the `encrypt` option is set to `false`.
If you tested your Animal Kingdom, you can see this on your profile. To see your
profile, go to the Blockstack
diff --git a/_includes/keyphrase.md b/_includes/keyphrase.md
index 74c578c4..636799b5 100644
--- a/_includes/keyphrase.md
+++ b/_includes/keyphrase.md
@@ -32,7 +32,7 @@ Use the following table to answer questions about keys/phrases/values you can sh
PROTECT
An long encrypted string, for example:
36mWivFdy0YPH2z31EflpQz/Y0UMrOrJ++lH=0EI7c3mop2JuRBm5WXxSTazJsUjOA...
Do not share the QR code that accompanied your code either. This is a QR code:
An long encrypted string, for example:
36mWivFdy0YPH2z31EflpQz/Y0UMrOrJ++lH=0EI7c3mop2JuRBm5WXxSTazJsUjOA...
Do not share the QR code that accompanied your recovery code either. This is a QR code: