> For the complete documentation index, see [llms.txt](https://help.santesuite.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.santesuite.org/developers/server-plugins/implementing-.net-features/service-definitions/password-hashing-service.md).

# Password Hashing Service

`IPasswordHashingService` in assembly SanteDB.Core.Api version 3.0.1980.0

## Summary

Password hashing service.

## Operations

| Operation   | Response/Return | Input/Parameter       | Description               |
| ----------- | --------------- | --------------------- | ------------------------- |
| ComputeHash | String          | *String* **password** | Compute the password hash |
| ComputeHash | Byte\[]         | *Byte\[]* **data**    | Compute the password hash |

## Implementations

### SHA1 Password Encoding Service - (SanteDB.Core.Api)

SHA1 password generator service

#### Service Registration

```markup
...
<section xsi:type="ApplicationServiceContextConfigurationSection" threadPoolSize="4">
	<serviceProviders>
		...
		<add type="SanteDB.Core.Security.SHA1PasswordHashingService, SanteDB.Core.Api, Version=3.0.1980.0, Culture=neutral, PublicKeyToken=null" />
		...
	</serviceProviders>
```

### SHA256 Password Encoding Service - (SanteDB.Core.Api)

SHA256 password generator service

#### Service Registration

```markup
...
<section xsi:type="ApplicationServiceContextConfigurationSection" threadPoolSize="4">
	<serviceProviders>
		...
		<add type="SanteDB.Core.Security.SHA256PasswordHashingService, SanteDB.Core.Api, Version=3.0.1980.0, Culture=neutral, PublicKeyToken=null" />
		...
	</serviceProviders>
```

## Example Implementation

```csharp
/// Example Implementation
using SanteDB.Core.Security.Services;
/// Other usings here
public class MyPasswordHashingService : SanteDB.Core.Security.Services.IPasswordHashingService { 
	public String ServiceName => "My own IPasswordHashingService service";
	/// <summary>
	/// Compute the password hash
	/// </summary>
	public String ComputeHash(String password){
		throw new System.NotImplementedException();
	}
	/// <summary>
	/// Compute the password hash
	/// </summary>
	public Byte[] ComputeHash(Byte[] data){
		throw new System.NotImplementedException();
	}
}
```

## References

* [IPasswordHashingService C# Documentation](http://santesuite.org/assets/doc/net/html/T_SanteDB_Core_Security_Services_IPasswordHashingService.htm)
* [SHA1PasswordHashingService C# Documentation](http://santesuite.org/assets/doc/net/html/T_SanteDB_Core_Security_SHA1PasswordHashingService.htm)
* [SHA256PasswordHashingService C# Documentation](http://santesuite.org/assets/doc/net/html/T_SanteDB_Core_Security_SHA256PasswordHashingService.htm)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://help.santesuite.org/developers/server-plugins/implementing-.net-features/service-definitions/password-hashing-service.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
