summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--rsa/__init__.py15
-rw-r--r--rsa/common.py17
-rw-r--r--rsa/core.py15
-rw-r--r--rsa/key.py16
-rw-r--r--rsa/pem.py16
-rw-r--r--rsa/pkcs1.py16
-rw-r--r--rsa/prime.py16
-rw-r--r--rsa/randnum.py16
-rw-r--r--rsa/transform.py16
9 files changed, 143 insertions, 0 deletions
diff --git a/rsa/__init__.py b/rsa/__init__.py
index 0b2631f..b616d7a 100644
--- a/rsa/__init__.py
+++ b/rsa/__init__.py
@@ -1,3 +1,18 @@
+# -*- coding: utf-8 -*-
+#
+# Copyright 2011 Sybren A. Stüvel <sybren@stuvel.eu>
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
"""RSA module
Module for calculating large primes, and RSA encryption, decryption, signing
diff --git a/rsa/common.py b/rsa/common.py
index 7c852b6..573c427 100644
--- a/rsa/common.py
+++ b/rsa/common.py
@@ -1,5 +1,22 @@
+# -*- coding: utf-8 -*-
+#
+# Copyright 2011 Sybren A. Stüvel <sybren@stuvel.eu>
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
'''Common functionality shared by several modules.'''
+
import math
def bit_size(number):
diff --git a/rsa/core.py b/rsa/core.py
index 7b8b837..b66eaea 100644
--- a/rsa/core.py
+++ b/rsa/core.py
@@ -1,3 +1,18 @@
+# -*- coding: utf-8 -*-
+#
+# Copyright 2011 Sybren A. Stüvel <sybren@stuvel.eu>
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
'''Core mathematical operations.
This is the actual core RSA implementation, which is only defined
diff --git a/rsa/key.py b/rsa/key.py
index 01168db..5afb459 100644
--- a/rsa/key.py
+++ b/rsa/key.py
@@ -1,3 +1,19 @@
+# -*- coding: utf-8 -*-
+#
+# Copyright 2011 Sybren A. Stüvel <sybren@stuvel.eu>
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
'''RSA key generation code.
Create new keys with the newkeys() function. It will give you a PublicKey and a
diff --git a/rsa/pem.py b/rsa/pem.py
index e11c8c3..9e159e8 100644
--- a/rsa/pem.py
+++ b/rsa/pem.py
@@ -1,3 +1,19 @@
+# -*- coding: utf-8 -*-
+#
+# Copyright 2011 Sybren A. Stüvel <sybren@stuvel.eu>
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
'''Functions that load and write PEM-encoded files.'''
import base64
diff --git a/rsa/pkcs1.py b/rsa/pkcs1.py
index d8d9dba..9a76e40 100644
--- a/rsa/pkcs1.py
+++ b/rsa/pkcs1.py
@@ -1,3 +1,19 @@
+# -*- coding: utf-8 -*-
+#
+# Copyright 2011 Sybren A. Stüvel <sybren@stuvel.eu>
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
'''Functions for PKCS1 version 1.5 encryption and signing
This module implements certain functionality from PKCS1 version 1.5. For a
diff --git a/rsa/prime.py b/rsa/prime.py
index d477569..4b2cb2e 100644
--- a/rsa/prime.py
+++ b/rsa/prime.py
@@ -1,3 +1,19 @@
+# -*- coding: utf-8 -*-
+#
+# Copyright 2011 Sybren A. Stüvel <sybren@stuvel.eu>
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
'''Numerical functions related to primes.'''
__all__ = [ 'getprime', 'are_relatively_prime']
diff --git a/rsa/randnum.py b/rsa/randnum.py
index 7db6243..07e80d2 100644
--- a/rsa/randnum.py
+++ b/rsa/randnum.py
@@ -1,3 +1,19 @@
+# -*- coding: utf-8 -*-
+#
+# Copyright 2011 Sybren A. Stüvel <sybren@stuvel.eu>
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
'''Functions for generating random numbers.'''
import math
diff --git a/rsa/transform.py b/rsa/transform.py
index 179ed9d..0db546b 100644
--- a/rsa/transform.py
+++ b/rsa/transform.py
@@ -1,3 +1,19 @@
+# -*- coding: utf-8 -*-
+#
+# Copyright 2011 Sybren A. Stüvel <sybren@stuvel.eu>
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
'''Data transformation functions.
From bytes to a number, number to bytes, base64-like-encoding, etc.