That's right, everything in the blockchain is public, so the only way to store information on the blockchain that you don't want everyone to be able to read is by encrypting it before storing. But then not even the smart contract can process it, because if you want the smart contract to be able to decrypt the message, then you would have to store the decryption key in the smart contract, which would then break all the secrecy again.
So if the information can be accessed only from the outside, then store the data encrypted and you're fine!
EDIT: add an example of encryption using node js
const crypto = require('crypto');
const algorithm = 'aes-256-cbc';
const key = crypto.randomBytes(32);
const iv = crypto.randomBytes(16);
function encrypt(text) {
let cipher = crypto.createCipheriv(algorithm, Buffer.from(key), iv);
let encrypted = cipher.update(text);
encrypted = Buffer.concat([encrypted, cipher.final()]);
return { iv: iv.toString('hex'),
encryptedData: encrypted.toString('hex') };
}
var encrypted = encrypt("Hello World!");
console.log("Encrypted Text: " + encrypted.encryptedData);
// Then you can call your contract store() with the encrypted data