SlidePub
Home
Categories
Login
Register
Home
Design
Project_Setup_and_Implementation_that helps in smart contract.pptx
Project_Setup_and_Implementation_that helps in smart contract.pptx
JackOchieng3
9 views
9 slides
Oct 16, 2024
Slide
1
of 9
Previous
Next
1
2
3
4
5
6
7
8
9
About This Presentation
this helps is NS3 to smart contract
Size:
36.21 KB
Language:
en
Added:
Oct 16, 2024
Slides:
9 pages
Slide Content
Slide 1
Project Setup and Security Implementation AES Encryption, CP-ABE Access Control, and Blockchain Integration
Slide 2
Step 1: Project Setup Install necessary libraries: npm install mongoose dotenv cryptojs openabe Create .env file: MONGO_URI=mongodb+srv://<username>:<password>@cluster.mongodb.net/<database>
Slide 3
Step 2: File Placement and Configuration 1. Database Configuration (db.js) require('dotenv').config(); const mongoose = require('mongoose'); const connectDB = async () => { ... };
Slide 4
Step 3: AES Encryption (encryption.js) const crypto = require('crypto'); const algorithm = 'aes-256-cbc'; const key = crypto.randomBytes(32); exports.encrypt = (text) => { ... };
Slide 5
Step 4: Model Creation (HealthcareData.js) const mongoose = require('mongoose'); const HealthcareDataSchema = new mongoose.Schema({ encryptedData: String, iv: String, createdAt: { type: Date, default: Date.now } });
Slide 6
Step 5: CP-ABE Access Control const { OpenABE } = require('openabe'); exports.encryptWithPolicy = async (policy, data) => { ... }; exports.decryptWithAttributes = async (attributes, data) => { ... };
Slide 7
Step 6: Chatbot Integration chatbot.on('message', async (msg) => { const entry = await HealthcareData.findById(msg.id); const data = decrypt(entry.encryptedData, entry.iv); chatbot.sendMessage(msg.chat.id, `Data: ${data}`); });
Slide 8
Step 7: Blockchain Verification const axios = require('axios'); const verifyAccess = async (hash) => { const url = `https://nanexplorer.com/api/block/${hash}`; const response = await axios.get(url); return response.data ? true : false; };
Slide 9
Conclusion 1. Encrypt data before saving to MongoDB. 2. Use CP-ABE to control access. 3. Ensure chatbot only decrypts for authorized users. 4. Verify access attempts using Nano blockchain.
Tags
Categories
Design
Healthcare
Technology
Download
Download Slideshow
Get the original presentation file
Quick Actions
Embed
Share
Save
Print
Full
Report
Statistics
Views
9
Slides
9
Age
412 days
Related Slideshows
1
MGV Residential Design projects for different clients, including a New Mexico Adobe project-1-.pdf
mannyvesa
27 views
16
EUNITED_Advocacy and Public Engagement through Visual Media
GeorgeDiamandis11
32 views
31
DESIGN THINKINGGG PPT 2 TOPIC IDEATION.pptx
HibaZaidi2
25 views
36
DESIGN THINKING CHAPTER 1 PPTT PPT 1.pptx
HibaZaidi2
29 views
112
Hinduism and Its History - PowerPoint Slides.pptx
ConorMcCormack10
25 views
20
Service Attributes of Manufactured Parts.pptx
MustafaEnesKrmac
25 views
View More in This Category
Embed Slideshow
Dimensions
Width (px)
Height (px)
Start Page
Which slide to start from (1-9)
Options
Auto-play slides
Show controls
Embed Code
Copy Code
Share Slideshow
Share on Social Media
Share on Facebook
Share on Twitter
Share on LinkedIn
Share via Email
Or copy link
Copy
Report Content
Reason for reporting
*
Select a reason...
Inappropriate content
Copyright violation
Spam or misleading
Offensive or hateful
Privacy violation
Other
Slide number
Leave blank if it applies to the entire slideshow
Additional details
*
Help us understand the problem better