Difference between Pasting and typing?

  • Thread starter lionely
  • Start date
  • Tags
    Difference
In summary, the conversation discusses the issue of not being able to paste passwords in certain websites and the reasons behind it. It is explained that this can be due to differences in inputs from the operating system clipboard and the keyboard, and how this can be controlled through programming languages like JavaScript. The expert also mentions that there are various methods to prevent password pasting, such as using flags or disabling the input temporarily.
  • #1
lionely
576
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
  • #2
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.
 
  • #3
Oh I see. Thanks!
 
  • #4
i've come across the same, but it won't let me paste anything in the box :confused:
 
  • #5
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:
  • #6
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.
 
  • #7
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:

1. What is the main difference between pasting and typing?

The main difference between pasting and typing is the method of input. Pasting involves copying text or data from one source and inserting it into another location, while typing involves manually entering text using a keyboard.

2. Which method is faster, pasting or typing?

In most cases, typing is faster than pasting. This is because pasting involves multiple steps, such as copying and navigating to the desired location, while typing is a direct input method.

3. Can pasting and typing result in different formatting?

Yes, pasting and typing can result in different formatting. When pasting, the formatting of the original source may be retained, while typing will use the default formatting of the destination location.

4. Is there a limit to the amount of text that can be pasted or typed?

There may be limits to the amount of text that can be pasted or typed, depending on the specific software or platform being used. Generally, typing has a higher limit as it is a manual input method, while pasting may have a lower limit due to limitations of the copy and paste function.

5. Which method is more accurate, pasting or typing?

In terms of accuracy, typing is generally more reliable as it allows for direct input and correction of errors in real-time. Pasting, on the other hand, relies on the accuracy of the copied text or data and may result in errors if the original source has mistakes or formatting issues.

Similar threads

Replies
12
Views
554
  • Computing and Technology
3
Replies
84
Views
4K
  • Computing and Technology
2
Replies
37
Views
3K
  • Computing and Technology
Replies
14
Views
1K
Replies
6
Views
6K
  • Computing and Technology
Replies
11
Views
1K
Replies
4
Views
3K
  • Computing and Technology
Replies
10
Views
694
  • Computing and Technology
Replies
3
Views
3K
  • Computing and Technology
Replies
17
Views
2K
Back
Top