How do you use a public key to encrypt a string

I am oversimplifying but I understand that a public key is the product of two large prime numbers. In essence as long as the private key is kept private, the owner knows something that the outside world does not.

My question is, how, in simple terms does one take a string or number (like a proposed symmetric key for a session) and encrypt it with the public key, in such a way that

a) the rest of the world with the public key cannot (since they also have the public key) and   b) the owner with the private key can?   

Thanks.

Should the attributes of a class be part of the public interface even when they could break its methods?

As a minimal example, consider the following (in Python):

class Foo:     def __init__(self, bar):         # Assume bar is a valid at this point         self.bar = bar      def divide_by_bar(self, num):         return num / self.bar 

If the attribute bar is public, my understanding is that it is valid for the client to do something like:

>>> foo = Foo(1) >>> foo.bar = 0 >>> foo.divide_by_bar(2) Traceback (most recent call last):    ... ZeroDivisionError: division by zero 

We encountered a more complex version of this in our team and I suggested to make the attribute private, or read-only (or to consider the handling the exception). However, I got the reply that, since it is only used in one place in our code base, it is fine to leave it like that. I agreed to that, but I have noticed numerous examples of this practice in our code base and I am uncertain when should one be more strict with these cases. Should I ignore it until it is used in multiple places?

Scalable Design to combine large S3 files and provide a public download link through Email

I have multiple files on AWS S3 Bucket. According to Access of a person I need to create a ZIP file of multiple selected files & provide a public link to download it.

  1. I want to use a queue to put coming requests in it & process one by one And once This is complete I want to send the link for download.
  2. I want to save it in S3 Bucket and send a link once clicked it should be downloaded securely from SpringBoot rest API. If not downloaded it should be deleted after expiry time of few days after creation.

I need to know What Technologies should I use ? Can I achieve this with AWS Lambda ? What should I prefer for queuing the tasks. If any alternative approach please suggest.

Public report/telemetry API

I want to implement a telemetry data sender into my electron app. The API which I want to connect to is public. So any crash reports or any other data from the user is sent to it. The problem is how do I secure the API to prevent spam reports?

For example VS Code is collecting telemetry data from the user and it’s sending those data to a collecting REST API. How does Microsoft prevent spam reports?

The structure is the following

Electron App -> User Data -> (How to prevent spam?) API Server -> Database

Thanks

Oracle procedure takes forever to compile if I use public synonym

I have a procedure that queries a table through a DB link. If my procedure uses a public synonym through the DB link, it takes forever to compile.

I’m creating the procedure in Oracle 12c. The DB link is connected to Oracle 18c. The source database was recently upgraded from 12c to 18c. The procedure was fine after the upgrade until I tried to recompile it.

Here are some details about what I’ve observed.

The following insert statement works and inserts W.

CREATE TABLE TEST_DB_LINK_PROC (VAL varchar(1)); INSERT INTO TEST_DB_LINK_PROC select 'W' from MYTABLE@MYDBLINK WHERE ROWNUM < 2; commit; 

The insert in this procedure inserts X. Here I’ve added the schema.

CREATE OR REPLACE PROCEDURE TEST_PROCEDURE_DB_LINK_A is BEGIN     INSERT INTO TEST_DB_LINK_PROC      SELECT 'X' FROM MYSCHEMA.MYTABLE@MYDBLINK      WHERE ROWNUM < 2;     COMMIT; END TEST_PROCEDURE_DB_LINK_A;  EXEC TEST_PROCEDURE_DB_LINK_A; 

But when I try to create the same procedure using the public synonym (like in the original insert statement), the procedure takes forever to compile:

CREATE OR REPLACE PROCEDURE TEST_PROCEDURE_DB_LINK_B is BEGIN INSERT INTO TEST_DB_LINK_PROC SELECT 'Y' FROM MYTABLE@MYDBLINK WHERE ROWNUM < 2; COMMIT; END TEST_PROCEDURE_DB_LINK_B; 

It appears that I can work around this issue by putting the schema in each query. I have a lot of these procedures, so I’m hoping not to do that.

Sudo apt update returns unverified and unsigned signatures due to unavailable public keys? This stemmed from wanting to reinstall wine

I’m a broke college student whose hard drive recently died, instead of paying for a new copy of windows I went with an Ubuntu distribution. I know very little about computers and have been fumbling blind through google and help threads to this point today.

To give you some idea of my level of experience.

I’ve been trying to run a couple different .exe files through Wine, which hasn’t been working. I figured I could try a fresh reinstall of wine and ran through these steps as proposed by an article on PCsuggest posted in 2018:

sudo apt-get purge wine wine-*

sudo apt-get autoremove –purge

rm -rf ~/.wine/

rm -rf ~/.local/share/applications/wine*

Again, no idea what I’m doing here.

I then ran through the steps laid out to install Wine from the winehq site for Ubuntu 18.04. Which went well up until the

sudo apt-add-repository ‘deb https://dl.winehq.org/wine-builds/ubuntu/ bionic main’

line, which didn’t seem to work.Nevertheless, I’m pig-headed enough to keep moving forwards, so then I tried sudo apt update, which definitely didn’t work. That command returned this:

Ign:1 [X]dl.google.com/linux/chrome/deb stable InRelease Hit:2 [X]download.mono-project.com/repo/ubuntu stable-bionic InRelease
Hit:3 [X]dl.google.com/linux/chrome/deb stable Release
Hit:5 [X]repo.steampowered.com/steam precise InRelease
Hit:6 [X]dl.winehq.org/wine-builds/ubuntu bionic InRelease
Hit:7 [X]us.archive.ubuntu.com/ubuntu bionic InRelease
Hit:8 [X]us.archive.ubuntu.com/ubuntu bionic-security InRelease
Hit:9 [X]us.archive.ubuntu.com/ubuntu bionic-updates InRelease
Ign:12 [X]ppa.launchpad.net/cairo-dock-team/ppa/ubuntu bionic InRelease
Hit:13 [X]ppa.launchpad.net/diesch/testing/ubuntu bionic InRelease
Ign:14 [X]ppa.launchpad.net/falk-t-j/qtsixa/ubuntu bionic InRelease
Get:4 [X]ppa.launchpad.net/otto-kesselgulasch/gimp/ubuntu bionic InRelease [15.4 kB] Err:4 [X]ppa.launchpad.net/otto-kesselgulasch/gimp/ubuntu bionic InRelease The following signatures couldn’t be verified because the public key is not available: NO_PUBKEY 3BDAAC08614C4B38 Get:11 [X]ppa.launchpad.net/libreoffice/ppa/ubuntu bionic InRelease [20.7 kB] Err:11 [X]ppa.launchpad.net/libreoffice/ppa/ubuntu bionic InRelease
The following signatures couldn’t be verified because the public key is not available: NO_PUBKEY 83FBA1751378B444 Err:15 [X]ppa.launchpad.net/cairo-dock-team/ppa/ubuntu bionic Release
404 Not Found [IP: 91.189.95.83 80] Err:16 [X]ppa.launchpad.net/falk-t-j/qtsixa/ubuntu bionic Release 404 Not Found [IP: 91.189.95.83 80] Reading package lists… Done W: GPG error: http://ppa.launchpad.net/otto-kesselgulasch/gimp/ubuntu bionic InRelease: The following signatures couldn’t be verified because the public key is not available: NO_PUBKEY 3BDAAC08614C4B38 E: The repository ‘http://ppa.launchpad.net/otto-kesselgulasch/gimp/ubuntu bionic InRelease’ is not signed. N: Updating from such a repository can’t be done securely, and is therefore disabled by default. N: See apt-secure(8) manpage for repository creation and user configuration details. W: GPG error: http://ppa.launchpad.net/libreoffice/ppa/ubuntu bionic InRelease: The following signatures couldn’t be verified because the public key is not available: NO_PUBKEY 83FBA1751378B444 E: The repository ‘http://ppa.launchpad.net/libreoffice/ppa/ubuntu bionic InRelease’ is not signed. N: Updating from such a repository can’t be done securely, and is therefore disabled by default. N: See apt-secure(8) manpage for repository creation and user configuration details. E: The repository ‘http://ppa.launchpad.net/cairo-dock-team/ppa/ubuntu bionic Release’ does not have a Release file. N: Updating from such a repository can’t be done securely, and is therefore disabled by default. N: See apt-secure(8) manpage for repository creation and user configuration details. E: The repository ‘http://ppa.launchpad.net/falk-t-j/qtsixa/ubuntu bionic Release’ does not have a Release file. N: Updating from such a repository can’t be done securely, and is therefore disabled by default. N: See apt-secure(8) manpage for repository creation and user configuration details.

Any help?

I should mention, earlier the problem was a broken line in the sources.list file related to wine. Which I fixed by realizing that (I think?) I had a sources.list file for Ubuntu 16.04, which is the version I installed initially onto my laptop from a flashdrive before updating to 18.04. So I mosey-d on over to https://repogen.simplylinux.ch/ and downloaded a sources.list file for 18.04 and replaced the old one. I have both files backed up as text files on my desktop rn so if I need to put that 16.04 file back in, I think I can do that.

Any help would be appreciated.

[X]-https:// since this is my first post here I don’t have enough reputation to submit more than eight links.