Stack Exchange Network

Stack Exchange network consists of 174 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
vote
1answer
253 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 <...
2
votes
2answers
73 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
35 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 ...
2
votes
1answer
54 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
55 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
47 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
66 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
167 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
265 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
236 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
48 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
124 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
141 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
100 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
245 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
249 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
34 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
109 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
236 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
135 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
186 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
89 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
76 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
78 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
512 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
70 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
115 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
113 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
2k 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
141 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
218 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
336 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
711 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
422 views

Bash script to replace string in database

How secure is my script? ...
1
vote
0answers
40 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 ...
11
votes
3answers
593 views

Secured registration script

I created code for my registration form on my social network. I want to know if it is secured enough to release on the web as a public social network. Also, all of the code works. I just want to make ...
4
votes
1answer
117 views

OpenVPN Login Bash Shell script for DD-WRT router

This script is made to run on DD-WRT as I am running an OpenVPN server on it just to securely connect to my home network when I'm on the go. Basically, the input ($1...
0
votes
0answers
38 views

C# Security Module for generating secure hashes

Any pointers on the level of security this hashing function perform at? I have never had to really write my own modules for security before. ...
1
vote
0answers
67 views

Python: is answer grader program secure?

I am creating my own problems that people have to solve and I want to make a grader check if a user put in the right answers and then reward them with a flag. My code for one particular problem: <...
7
votes
2answers
201 views

Bash script to temporarily run a shell without certain group memberships

I have here a script called rwog (run without groups) that allow a user to run a shell without particular group memberships. ...
1
vote
1answer
356 views

Handling FTP exceptions like no internet etc

I'm currently working in a project where the user needs to log in and after that i will check if the directory /cloud/user/Projects exists and if it doesn't i will create them. The code works, ...
4
votes
0answers
90 views

(de-)serializer for arbitrary python objects

My program is intended to allow (de-)serialization of arbitrary Python objects. It's basically a replacement for python's pickle module, which is similar but prone ...
0
votes
0answers
10 views

Barebones cookie functions - just the necessities

I'm attempting to make a simple set of functions to handle cookies. They will only be used to store and retrieve an auth token for accessing an external API. I'm keeping it simple and using some ...
1
vote
1answer
118 views

PHP member login system

I have php cookie based login system on my website using below given code. I want to know that whether this login system is secure or not, Whether it can be hacked in any way? ...
0
votes
0answers
12 views

Creating a File instance via Javascript fails in Firefox v21.0

I'm working on a Javascript function to create a text file from some dynamic data, and upload it to a server. Using the File interface, I was able to dynamically create a file successfully when ...
1
vote
1answer
134 views

Getting table cell contents in a row and displaying them as a concatenated tooltip on each cell

I have a JavaScript code that gets the inner text content of certain table cells in a row and displays them as a tooltip on mouseover. However, I am a novice at JavaScript and I do not know how to ...