Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
I'm looking to implement end-to-end encryption for messages sent between users in my Laravel app. I want to encrypt these messages in a way that they are only viewable by the sender and receiver (just like in secure messaging apps like WhatsApp). No one else can read them, including admins or dbas.
How would I go about doing this?
I should also mention that the messages will be sent through the browser to the server by a JavaScript AJAX request and pushed to the other user by Node.js / socket.io setup.
Would be helpful if you have posted some examples that you have tried. Here are the steps that you can follow to achieve it.
Step 1. You will have to establish a private chat between Client and server. An example can be seen here: Creating a private chat between a key using a node.js and socket.io
Step 2. Add encryption/decryption logic for the messages at Client side. Here is a logic for the same: https://github.com/sytelus/CryptoJS
Related
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 4 years ago.
Improve this question
I got a request at work to create an SMTP server so that our website can sent automatic emails on daily/weekly basis. In simple - we have a website running on node.js and I need to give it an ability to automatically send emails based on time or/and other conditions.
Since I never worked in this direction (and I just got into this field) I decided to ask a question here, to see what you(experts) have to say in regards of this subject.
p.s I might have a wrong understanding of how this should run, so feel free to correct anything that I said.
Since setting up a brand new smtp server and managing correct configuration, security, and most important, domain/ip reputation can be a real pain, I would suggest using a cloud service for this task to get you going faster.
A few of these services, some of them with free tiers are Amazon SMS, Mailgun, SendGrid and Mandrill. At least Mailgun has a API wrapper available for Node.JS.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 4 years ago.
Improve this question
I want to use the Stripe API for adding customer data using plain javascript.
Unfortunately there are no Javascript examples in the Stripe Docs... https://stripe.com/docs/api
I want to use Ajax POSTS
Now my questions are:
a) Where do I have to put my api key?
b) How do I send data and where exactly do I have to input it into the script?
c) What parameters do I have to use?
You can not do any of this in Javascript client-side for security reasons. Most API requests require your Secret API key. This key is really sensitive and something you should keep secure at all time.
If you use that key client-side then anyone can look at the source of your page and then use that key to create new charges, refund all your charges or delete all your customers.
Client-side, you would only collect card details securely with Elements or Checkout. This gives you a card token tok_XXXX and then you send that token to your server where you will create a Charge or a Customer.
That last part can be done in Javascript using Stripe's Node.js library but the code has to run server-side.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
I am newbie to web designing. Here I am trying to develop a web page where it prompts for username and password and when I click on button, this html has to make connection with these username and password values entered by user to Marklogic database . Could anyone please help how to do this? Is it through Javascript or PHP? If so please advise where can I find step by step explanation of this process ? Also it is okay if I get procedure for any NOSQL database.
OK. Your statement is a bit big and broad.. I decided to extract the most relevant concepts:
Sample Application including authentication
MarkLogic
Javascript or PHP
Therefore, I suggest looking at a reference framework using all javascript:
http://www.marklogic.com/what-is-marklogic/whats-new/samplestack/
This can have a node.js middle tier in node.js and does not require java.
It is a big step forward and (sort of) complex, but it is a complete example.
If it is too much for what you are looking for, then I suggest you research more specifically what you need in these two specific items in MarkLogic documents:
HTTP Server (where you can run your HTML/CSS/Javascript from)
REST API (for which you can use against your js code)
This is a 2-tier approach where your application(HTTP) server is serving both your HTTP site as well s the default REST enpoints.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
How JavaScript take user ID and password? And where do it stores that data? And how it check the authentication when next time user wants to login in?
It doesn't. JavaScript running in the browser cannot perform meaningful authentication. You'd need a server-side application that performs the authentication. At most, JavaScript could perform an AJAX request, sending the user ID and password to the server — but how exactly you'd do that would depend entirely on the application. You'd need to read the documentation for your system to find out how authentication is performed.
(It is conceivable that we're talking about a server-side application written in JavaScript à la node.js, but since the question is not tagged as such I'm assuming not.)
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
Okay guys, I'm trying to integrate a facebook-like messaging system into my web application. I can't post the link unfortunately because it requires login.
I have the database with a conversation table, a messages table, and the html page which calls all the messages based on the given conversation id. I also have a text area and submit button for sending a new message and adding it to the database.
Now I've heard two different methods..
That I should have javascript check for updates every second or so to see new messages, and update with ajax. Would this put too much strain on a server?
or.
To use a frame work like node.js. This method makes very little sense to me as I really don't understand requests very well.
So stack overflow, which method (or neither) would be the best way to implement this?
Polling is resource-heavy. You should consider something like WebSockets.
With WebSockets, you basically will have the client chat user apps subscribe the to the WebSocket, and then the back end server application would notify them when they should check for updates, or just push the new message updates out to them right over the WebSocket connection.
Here is a demo chat application you can look at. Here's the WebSocket website.