How to create invisible widget in Drupal
Install the Field Permissions module:


  The Field Permissions module allows site administrators to set field-level permissions to edit, view and create fields on any entity.


And the Computed Field module:


  Computed Field is a very powerful CCK field module that lets you add a custom "computed fields" to your content types. These computed fields are populated with values that you define via PHP code. You may draw on anything available to Drupal, including other fields, the current user, database tables, you name it.


You can then create a field for your value, hide it from the registration/profile form, and use Computed Field to set its value to whatever you need it to be automatically.