Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [security]

Computer security is security applied to computing devices such as computers and smartphones, as well as to both private and public computer networks, including the whole Internet.

-1
votes
0answers
10 views

Java programming [on hold]

I have been working on this program a while trying to fix this problem, but with no success. So I ask for some assistance here. This java program gives the error: ...
2
votes
1answer
49 views

Is it enough for PHP secure session class?

I need you help with my php session class. I can not understand, the class implements adequate work with sessions. By adequate work, I understand the security and correctness of the methods. ...
2
votes
2answers
40 views

PHP Secure Login Scripts

I have created this login script for a website I'm making; basically I want to make it as secure as possible, but also I want it to keep users logged in for 30 minutes. For example if I've logged in ...
2
votes
0answers
27 views

Python RSA/DSA File Cryptography, Key Generation, Key Protection

I have forked a previous version of my script, critiqued here: Generate public/private keys, encrypt, decrypt, sign, verify This program allows you to encrypt and decrypt raw files using RSA keys ...
-7
votes
0answers
40 views

Use email verification and cookies to secure user accounts instead of passwords? [closed]

I'm looking for feedback/collaboration. I posted a question on stack overflow and it was recommended that this site would be a more appropriate place for the feedback I'm seeking. Please be patient, ...
1
vote
0answers
114 views

Python 3.x Cryptography Fernet / AES256

I wrote this code to make easy use of the Python library Cryptography to encrypt data using either Fernet or AES256 CBC with a HMAC of the IV + CT I think it is safe and secure, given the user inputs ...
5
votes
1answer
56 views

Simple bash script creates apache2 virtualhost config for subdomain

Simple bash script to create apache2 virtualhost for localhost. Can be used for public subdomains on developer server with changes - "replace .localhost". Tested on Ubuntu, but should work where ...
0
votes
0answers
58 views

Sandboxing untrusted JavaScript execution by redeclaring variables

Suppose, via AJAX, I downloaded a string jsCode containing JavaScript code from a (potentially malicious) third-party website. I want to allow the code to implement ...
7
votes
2answers
702 views

Reading source code and extracting json from a url

I made a program to read the source code from a url. To reach this url I need to specify a token. After read the source code, I extract a url in json format, andIi ...
5
votes
2answers
68 views

PHP password-resetting page

I am producing a PHP code and I want to implement it in my server to do its function. My question is, are there any vulnerabilities that I should correct? I tried to establish the session first then ...
2
votes
0answers
60 views

Python/Django Class based saving

I'm creating multiple Django apps with vote possibilities, so I made an app vote to handle all this votes. In my templates I'm including an ajax-function named <...
3
votes
1answer
305 views

Upload a user's avatar

Could you guys tell me if my code is safe? And i want to know how to improve it. You will see a detailed explanation about the code on the comment blocks inside the code. profileIMGform.php <...
3
votes
2answers
90 views

PHP login system with prevention for session hijacking, fixation, injection, etc

I'm creating a login system and I have been reading a lot about the security measures needed to prevent session hijacking, fixation, and injection attacks, etc. These two Stack Overflow posts were ...
3
votes
1answer
44 views

PHP remote upload security

I need to upload images to a remote HTTP server from a local script. The image name format is {32-char MD5}.jpg. Server directory format is ...
3
votes
1answer
59 views

Queries to print out on the screen a list of menus

For common users I have 10 queries and for registered users I have 30 queries like this one below, only to print out on the screen the link for the querystrings, a guy said to me that I should escape ...
3
votes
1answer
80 views

Enhancing PHP realpath($path);

PHP realpath($path); is insufficient for some cases since it returns false on paths that dont exist on a file system. I need a function that extends realpath($path); to return even path that does not ...
1
vote
1answer
76 views

Notification system using PHP+jQuery+Ajax

I have this code to display a counter on the side of <i class="fas fa-bell mr-3"></i>. I want to know if this code is good on security and perfomance. ...
2
votes
1answer
117 views

Login system with password reset sent to e-mail using PHP and PDO

I really like to use PDO because it's simple and easy to make a safe query, i prepared all queries and used placeholders, i think it's safe but i'm not sure at all, and I'm thinking if i used ...
3
votes
2answers
287 views

Simple one time pad cipher

I had this idea not to long ago on creating a secure chat for people who need to be not meddled with when talking (like whistleblowers, hackers, etc) talking to one of my friends about it he said I ...
3
votes
1answer
274 views

Uploading and showing images securely

I've read various posts about how letting users to upload files can create vulnerabilities to your website such as a user injecting PHP code in an image. So I've created a small test project where ...
10
votes
1answer
318 views

XTEA Block Cipher

Usually people recommend to never implement cryptographic algorithms yourself unless you are an expert in the field. This of course makes a lot of sense mainly because there are numerous things that ...
4
votes
2answers
49 views

CGI for htpasswd registration

I decided to go with a very simple CGI user registration program to pair with Apache's mod_auth_form wrapper around a private site. It was only just after I ...
5
votes
0answers
136 views

Secure Password and Passphrase Generator in Python 3

I'm aware that people have implemented password/passphrase generators before, but I still went ahead and wrote my own, which I actually use for my own passwords and/or phrases. By "secure", I mean ...
1
vote
3answers
152 views

PHP script security for new user registration

I would like to ask the experts here if this is secure. If it is not can I get an explanation as to why it would not be secure? I have been reading off and on on sites for this and I have trouble ...
2
votes
1answer
126 views

Safe string formatting in Python

I am a fan of f"{strings}" in Python, However some situations could possibly be dangerous when doing f strings from user input, leaking API keys or even code ...
1
vote
2answers
379 views

Secure random password generator

I am developing an application that must generate a random password for each new user in the system (initial password). My idea is to use passwords of 16 characters long. Would like to know if the ...
1
vote
0answers
341 views

Secure password hashing implementation with salt and pepper

I share below my password hashing implementation with salt and pepper in C#, for your review and feedback. In my implementation methods like ValidatePassword(), ChangePassword() are in the user class. ...
1
vote
2answers
44 views

Running shell script as root via external binary

I'm not an experienced Linux user and I wanted an easy way to run shell scripts as root from a PHP script, I came up with this: ...
1
vote
0answers
40 views

Simple ruby program for AWS ruby SDK

I wrote a simple ruby program for interacting with one of my temporary AWS S3 using Ruby SDK. Below is the program I've written. Since I learned ruby by myself I need help/suggestions in following ...
-3
votes
1answer
112 views

Format data for a CSV item

This function formats the text in each cell of a CSV. The goal of the function is to make sure that the sequence of characters in text will never break the cell's ...
4
votes
1answer
384 views

Generating absolute URIs behind a reverse proxy

In my ASP.NET MVC application there are occasions where I need to generate an absolute URI, such as when sending an email confirmation link to a user. The most straightforward approach is to use ...
6
votes
1answer
160 views

Password Hashing and SQL Queries

I am new to web development and am working on a portfolio piece, so I would like to make sure I'm not creating obvious vulnerabilities. I am wondering whether there are any clear flaws in the ...
1
vote
0answers
225 views

Using postMessage() in JavaScript with iframes for cross domain communication

I am trying to enable communication via JavaScript from an iframe and its parent window when they are on different domains. I did a lot of research and it turned out that ...
0
votes
1answer
150 views

Encryption scripts using the module cryptography

Its meant to password protect python scripts by using encryption It should use os.urandom(40)'s output in hex as the salt. The kdf (cryptography.io) is using Scrypt ...
3
votes
0answers
79 views

Implementing secure API for use between other internal apps

My team and I are trying to implement a secure API and would appreciate some feedback on the following: If there are areas of improvement in the current code to improve security Recommendations on ...
2
votes
1answer
80 views

Keeping the average user from opening two copies of my program

I know that this is an impossible task against someone determined, but I'd like to keep mid-average users from being able to open more than one copy of my program at a time. Here's the quick code I'...
1
vote
2answers
39 views

chmod all .htaccess files under all website dirs under public_html dir

This is my code to chmod all .htaccess files under all website dirs under public_html dir. The reason I use this code is to make sure WordPress plugins won't "...
3
votes
1answer
919 views

Java AES file encryption/decryption

I've written a simple Java class to encrypt and decrypt files using AES. The code works and I'm able to encrypt and decrypt files. However, I understand this is an easy way of implementing AES and ...
2
votes
1answer
71 views

Simple routing system

This is my first routing system on PHP. As you can see it's very simple. Any advice or tip about it that can make it better? I want to make it better so I could use it in real websites. First I ...
6
votes
0answers
140 views

Security Helper Class According To NIST SP800-63B Guidelines

I've created a security helper class that attempts to adhere to the National Institute of Standards and Technology (NIST) "Digital Identity Guidelines" SP800-63B [June 2017] specs. These guidelines ...
3
votes
2answers
116 views

JSafebox - Encrypted vault - 2nd drill

I am developing JSafebox, a portable safebox project written in Java. A first review have been completed here. The goal is to provide a secured environment where the user can browse encrypted files ...
6
votes
2answers
3k views

Encrypt a byte array

This code is a Frankenstein. I found ten examples done in ten different ways and my requirements were slightly different so even if they were reliable they weren't a copy and paste solution. Encrypt ...
8
votes
2answers
151 views

Encrypted safebox

I am developing JSafebox, a portable safebox project written in Java. The goal is to provide a secured environment where the user can browse encrypted files without leaking data on the drive. The ...
7
votes
0answers
296 views

Let's register that Django user

Short intro So, I've been using Django for a while now and thought it would be nice to start a simple application. In an ideal World, each app must have a way of letting its users register and that's ...
1
vote
1answer
478 views

Security of User Add/Edit/Delete MySQL table

I have the following code which is working fine, however I am concerned around the security of this code and considering I am relatively new to php I was wondering whether the below code is secure? I ...
14
votes
5answers
3k views

Cryptographically Secure Password Generation in C

I am looking for ways to improve my password generation code written in C. This is in the same vein as my code in C++ and Python with many improvements. I am using ...
2
votes
1answer
959 views

PHP > 7.1 - MySQL Session Handler Class with some built-in time-management/security

I've created a class that implements the native SessionHandlerInterface (with added PHP v7+ functionality) while adding some minor security features. My main goal was to maintain native methods for ...
4
votes
1answer
436 views

Bash script to replace string in database

How secure is my script? ...
1
vote
0answers
46 views

Login/Register/Welcomepage/Updateuserprofile security improvements

I have created a Login, Register ,welcomepage(userprofile with updatefunction). I have done that without thinking about security. Now I would like to improve the security on these pages. Note: This ...
1
vote
0answers
13 views

Communication between privileged (function) and non-privileged (GUI) python script on macOS

Ok, so I am creating my own macOS cleaning app. Something like OnyX but then open-source and python based. The removal process requires administrative privileges but since I have read that it is ...