Difference between Pasting and typing?

  • Thread starter Thread starter lionely
  • Start date Start date
  • Tags Tags
    Difference
Click For Summary

Discussion Overview

The discussion revolves around the differences between pasting and typing passwords into web forms, exploring the technical reasons behind why some websites may not accept pasted passwords while allowing typed ones. The scope includes technical explanations and conceptual clarifications related to web development and user input handling.

Discussion Character

  • Technical explanation
  • Conceptual clarification
  • Debate/contested

Main Points Raised

  • One participant notes that pasting a password might fail due to invisible characters that could be included when copying from certain sources.
  • Another participant suggests that some web password fields may be programmed to prevent pasting from the clipboard, potentially using JavaScript to enforce this restriction.
  • A participant expresses curiosity about how programs differentiate between input from the clipboard and the keyboard, indicating a lack of technical knowledge on the subject.
  • Further elaboration includes a hypothetical scenario where a developer could implement a flag to control whether pasted input is accepted in a password field.
  • Participants discuss the possibility of loading a webpage without JavaScript to test if pasting is allowed, although caution is advised regarding terms of use.

Areas of Agreement / Disagreement

Participants express varying levels of understanding and curiosity about the mechanisms behind input handling, with no consensus on the exact methods used by web applications to differentiate between pasted and typed inputs.

Contextual Notes

Some participants acknowledge their lack of knowledge regarding the technical details of web browser input handling, which may limit the depth of the discussion. There are also references to potential methods for implementing input restrictions that are not universally applicable.

lionely
Messages
574
Reaction score
2
One day I was logging into my account on a website and if I copied and pasted the password it didn't work, but if I typed it out it logged me in. I was curious as to why this happens..

Could someone please elaborate for me please.
 
Computer science news on Phys.org
Usually you can paste your password, but it depends where you copied it from, there might invisible characters you can't see. I'm not aware of a method to detect a pasted password as opposed to a typed one on a website.
 
Oh I see. Thanks!
 
i've come across the same, but it won't let me paste anything in the box :confused:
 
Difference is that they come from different inputs. One comes from the operating system clipboard and another from the keyboard.

Password fields in the web, depending on the language (HTML, AS3, etc.) that the control was implemented can prevent passwords to be inserted from specific inputs. Also, if the control is from HTML it can be modified with JavaScript to reject any clipboard input.

If you are really into discovering what is preventing you from pasting a password, you can try loading the page without say the JavaScript code that is blocking the clipboard input into said field and see if it allows pasting. Just for fun. (Read the terms of use of the web page before. You don't want to or should mess with something forbidden).
 
Last edited:
But how does the program know how to differentiate between the clipboard and keyboard. Like the input from the keyboard has a different value or something? I don't really know the jargon. I don't work with these kind of things.
 
lionely said:
But how does the program know how to differentiate between the clipboard and keyboard. Like the input from the keyboard has a different value or something? I don't really know the jargon. I don't work with these kind of things.
EDIT: If it is JavaScript, then the language takes care of identifying the input source. It is inner workings that I have no knowledge of.

The web browser provides a layer that signals where the input came from. How exactly that mechanism works is unknown to me for I have never worked with web browsers source code. I really have no idea how that interface between the operating system clipboard and browser works, but it is there.

In Windows application development for example I could make a context menu for a TextBox with a button that reads "Paste" on it. If I wouldn't want my application to allow the user to paste anything in a password TextBox I would go for the onClick() event of that button and activate a flag (it can be a boolean value) so that in another event the password TextBox reads that flag and rejects any input.

Or in the very moment I activate the flag I could disable the TextBox for a few milliseconds, enough to not accept the input.

There are many ways.
 
Last edited:

Similar threads

  • · Replies 6 ·
Replies
6
Views
2K
  • · Replies 12 ·
Replies
12
Views
2K
  • · Replies 84 ·
3
Replies
84
Views
6K
  • · Replies 36 ·
2
Replies
36
Views
5K
  • · Replies 37 ·
2
Replies
37
Views
4K
  • · Replies 5 ·
Replies
5
Views
1K
Replies
6
Views
9K
  • · Replies 14 ·
Replies
14
Views
2K
Replies
4
Views
4K
  • · Replies 3 ·
Replies
3
Views
4K